commit | author | age
|
2f5b9b
|
1 |
/** |
B |
2 |
* Created by Jacky.gao on 2016/5/17. |
|
3 |
*/ |
|
4 |
var webpack = require('webpack'); |
|
5 |
var WebpackCleanupPlugin = require('webpack-cleanup-plugin'); |
|
6 |
module.exports = { |
|
7 |
entry: { |
|
8 |
designer:'./src/index.js', |
|
9 |
preview:'./src/preview.js', |
|
10 |
searchform: './src/form/index.js' |
|
11 |
}, |
|
12 |
output: { |
|
13 |
path: '../report-console/src/main/resources/report-asserts/js', |
|
14 |
filename: '[name].bundle.js' |
|
15 |
}, |
|
16 |
plugins: [ |
|
17 |
new webpack.optimize.UglifyJsPlugin({ |
|
18 |
compress: { |
|
19 |
warnings: false |
|
20 |
}, |
|
21 |
output: { |
|
22 |
comments: false |
|
23 |
} |
|
24 |
}), |
|
25 |
new webpack.DefinePlugin({ |
|
26 |
'process.env':{ |
|
27 |
'NODE_ENV': JSON.stringify('production') |
|
28 |
} |
|
29 |
}), |
|
30 |
new WebpackCleanupPlugin() |
|
31 |
], |
|
32 |
module: { |
|
33 |
loaders: [ |
|
34 |
{ |
|
35 |
test: /\.(jsx|js)?$/, |
|
36 |
exclude: /(node_modules|bower_components)/, |
|
37 |
loader: 'babel', |
|
38 |
query: { |
|
39 |
presets: ['react', 'es2015'], |
|
40 |
compact:true |
|
41 |
} |
|
42 |
}, |
|
43 |
{ |
|
44 |
test: /\.css$/, |
|
45 |
loader: "style-loader!css-loader" |
|
46 |
}, |
|
47 |
{ |
|
48 |
test: /\.json$/, |
|
49 |
loader: 'json-loader' |
|
50 |
} |
|
51 |
, |
|
52 |
{ |
|
53 |
test : /\.woff/, |
|
54 |
loader : 'url?prefix=font/&limit=10000&mimetype=application/font-woff' |
|
55 |
}, { |
|
56 |
test : /\.(ttf|png)/, |
|
57 |
loader : 'file?prefix=font/' |
|
58 |
}, { |
|
59 |
test : /\.eot/, |
|
60 |
loader : 'file?prefix=font/' |
|
61 |
}, { |
|
62 |
test : /\.svg/, |
|
63 |
loader : 'file?prefix=font/' |
|
64 |
} |
|
65 |
] |
|
66 |
} |
|
67 |
} |