File tree 6 files changed +12
-12
lines changed
6 files changed +12
-12
lines changed Original file line number Diff line number Diff line change 1
1
# typescript-webpack-react-flux-boilerplate
2
2
The goal of this repo is to help you start when combining React and Typescript.
3
3
It contains implementation of simple example based on flux pattern.
4
- LESS in combination of CSS modules is used for styling components and for running, building and bundling there is powerful Webpack.
4
+ LESS in combination of CSS modules is used for styling components. For running, building and bundling there is powerful Webpack.
5
5
6
6
## This boilerplate combines
7
7
* [ Typescript 2] ( https://github.com/Microsoft/TypeScript )
@@ -10,15 +10,16 @@ LESS in combination of CSS modules is used for styling components and for runnin
10
10
* [ Flux] ( https://github.com/facebook/flux )
11
11
* [ LESS] ( https://github.com/less/less.js )
12
12
* [ CSS modules] ( https://github.com/css-modules/css-modules )
13
- * [ Webpack] ( https://github.com/webpack/webpack )
13
+ * [ Webpack 2] ( https://webpack.js.org/ )
14
+ * [ Tslint] ( https://palantir.github.io/tslint/ )
14
15
15
16
## Getting started
16
17
* run ** npm install** to download dependencies
17
18
* run ** npm start** to build and start webpack-dev-server
18
19
* open ** http://localhost:3333/ **
19
20
20
21
## Build options
21
- * ** npm run build** for single build (creates files in build/ folder)
22
+ * ** npm run build** for single build (creates files and index.html in build/ folder)
22
23
* ** npm start** to build and start webpack-dev-server
23
24
24
25
## More information
Original file line number Diff line number Diff line change 5
5
< body >
6
6
< div id ="root ">
7
7
</ div >
8
- < script src ="/assets/vendors.js "> </ script >
9
- < script src ="/assets/app.js "> </ script >
10
8
</ body >
11
9
</ html >
Original file line number Diff line number Diff line change 30
30
"babel-preset-es2015-loose" : " ~8.0.0" ,
31
31
"css-loader" : " ~0.28.0" ,
32
32
"file-loader" : " ~0.11.1" ,
33
+ "html-webpack-plugin" : " ~2.28.0" ,
33
34
"less" : " ~2.7.2" ,
34
35
"less-loader" : " ~4.0.3" ,
35
36
"node-libs-browser" : " ~2.0.0" ,
Original file line number Diff line number Diff line change 1
- /// <reference path="node_modules/@types/node/index.d.ts"/>
2
-
3
1
var path = require ( 'path' ) ;
4
2
var webpack = require ( 'webpack' ) ;
5
3
var WebpackDevServer = require ( 'webpack-dev-server' ) ;
Original file line number Diff line number Diff line change 1
1
var path = require ( "path" ) ;
2
2
var webpack = require ( "webpack" ) ;
3
+ var HtmlWebpackPlugin = require ( "html-webpack-plugin" ) ;
3
4
4
5
var nodeModulesPath = path . join ( __dirname , 'node_modules' ) ;
5
6
var isProduction = process . env . NODE_ENV == "production" ;
@@ -61,7 +62,10 @@ var config = {
61
62
} ,
62
63
63
64
plugins : [
64
- new webpack . optimize . CommonsChunkPlugin ( { name : 'vendors' , filename : 'vendors_[chunkhash].js' } )
65
+ new webpack . optimize . CommonsChunkPlugin ( { name : 'vendors' , filename : 'vendors_[hash].js' } ) ,
66
+ new HtmlWebpackPlugin ( {
67
+ template : 'index.html'
68
+ } )
65
69
]
66
70
} ;
67
71
Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ var path = require("path");
6
6
7
7
var mainConfig = new Config ( ) . extend ( "webpack.config" ) ;
8
8
mainConfig . module . rules = [ ] ;
9
- mainConfig . plugins = [ ] ;
10
9
11
10
var devConfigExtension = {
12
11
entry : {
@@ -19,7 +18,7 @@ var devConfigExtension = {
19
18
20
19
output : {
21
20
filename : '[name].js' ,
22
- publicPath : "http://localhost:3333/assets/ "
21
+ publicPath : "http://localhost:3333/"
23
22
} ,
24
23
25
24
// more options here: http://webpack.github.io/docs/configuration.html#devtool
@@ -59,9 +58,8 @@ var devConfigExtension = {
59
58
} ,
60
59
61
60
plugins : [
62
- new webpack . optimize . CommonsChunkPlugin ( { name : 'vendors' , filename : 'vendors.js' } ) ,
63
61
// Used for hot-reload
64
- new webpack . HotModuleReplacementPlugin ( )
62
+ new webpack . HotModuleReplacementPlugin ( ) ,
65
63
]
66
64
} ;
67
65
You can’t perform that action at this time.
0 commit comments