-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwebpack.prod.js
34 lines (32 loc) · 998 Bytes
/
webpack.prod.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: [
'./demo/index.js'
],
output: {
path: require("path").resolve("./dist"),
filename: 'app.js',
sourceMapFilename: '[file].map',
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: "babel-loader",
query: {
presets: ['es2015', 'stage-1', 'react'],
plugins: ['transform-decorators-legacy']
}
},
{ test: /\.css$/, loader: "style-loader!css-loader" },
// { test: /\.(png|jpg|svg)$/, loader: 'url-loader?name=images/[name].[ext]&limit=100' }
]
},
plugins: [
new webpack.optimize.UglifyJsPlugin({minimize: true}),
new ExtractTextPlugin("[name].css"),
new webpack.NoErrorsPlugin()
]
};