File tree 3 files changed +15
-3
lines changed
3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 1
1
{
2
- "plugins" : [" transform-flow-strip-types" ]
2
+ "plugins" : [" transform-flow-strip-types" ],
3
+ "presets" : [" es2015" ]
3
4
}
Original file line number Diff line number Diff line change 7
7
"license" : " MIT" ,
8
8
"scripts" : {
9
9
"start" : " webpack --watch" ,
10
+ "build" : " DIST=true webpack" ,
10
11
"lint" : " eslint source" ,
11
12
"flow" : " flow check" ,
12
13
"flow:init" : " flow" ,
Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
+ const webpack = require ( 'webpack' ) ,
3
+ isDIST = process . env . DIST ,
4
+ uglifyConfig = {
5
+ cacheFolder : __dirname
6
+ } ;
7
+
8
+ console . log ( isDIST === 'true' )
2
9
module . exports = {
3
10
entry : './source/index.js' ,
4
11
output : {
5
12
path : __dirname + '/dist' ,
6
- filename : ' index.js'
13
+ filename : ` index.${ isDIST === 'true' ? 'min.' : '' } js`
7
14
} ,
8
15
module : {
9
16
loaders : [
10
17
{ test : / \. j s $ / , exclude : / n o d e _ m o d u l e s / , loader : 'babel-loader' }
11
18
]
12
- }
19
+ } ,
20
+ plugins : [
21
+ ( isDIST === 'true' ? new webpack . optimize . UglifyJsPlugin ( ) : null )
22
+ ]
13
23
} ;
You can’t perform that action at this time.
0 commit comments