-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwebpack.config.prod.js
46 lines (45 loc) · 1.1 KB
/
webpack.config.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
35
36
37
38
39
40
41
42
43
44
45
46
let webpack = require('webpack');
let path = require('path');
let autoprefixer = require('autoprefixer');
let HtmlWebpackPlugin = require('html-webpack-plugin');
let ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
context: path.join(__dirname, 'example'),
entry: {
js: ['./app.js'],
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: './bundle.js'
},
module: {
loaders: [
{
test: /\.js[x]?$/,
exclude: /node_modules/,
loader: 'babel',
}, {
test: /\.less$/,
loader: 'style!css!postcss!less'
}, {
test: /\.css/,
loader: ExtractTextPlugin.extract('style', 'css', 'postcss')
}, {
test: /\.(png|jpg|svg)$/,
loader: 'url?limit=25000'
}
]
},
postcss: [autoprefixer],
plugins: [
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
}),
new ExtractTextPlugin('antui-admin.min.css'),
new HtmlWebpackPlugin({
template: path.join(__dirname, 'example/index.html')
}),
]
};