-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.prod.js
45 lines (42 loc) · 1.09 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
/* eslint import/no-extraneous-dependencies: "off" */
const webpack = require('webpack');
const merge = require('webpack-merge');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const path = require('path');
const common = require('./webpack.common.js')
const GLOBALS = {
'process.env.NODE_ENV': JSON.stringify('production'),
__DEV__: false
};
module.exports = merge(common, {
mode: 'production',
devtool: 'source-map',
module: {
rules: [
{
test: /(\.css|\.scss|\.sass)$/,
use: ExtractTextPlugin.extract({
use: [
{
loader: 'css-loader',
options: {
minimize: true,
sourceMap: true
}
}, {
loader: 'sass-loader',
options: {
includePaths: [path.resolve(__dirname, 'src', 'scss')],
sourceMap: true
}
}
]
})
}
],
},
plugins: [
new webpack.DefinePlugin(GLOBALS),
new ExtractTextPlugin('[name].[md5:contenthash:hex:20].css'),
]
});