-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
48 lines (47 loc) · 1.35 KB
/
webpack.config.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
47
48
const ExtractCssChunks = require("extract-css-chunks-webpack-plugin");
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
module.exports = {
entry: ["./src/main.scss"],
output: {
path: __dirname + "/dist/"
},
module: {
rules: [
/*
your other rules for JavaScript transpiling go in here
*/
{
// css / sass / scss loader for webpack
test: /\.(css|sass|scss)$/,
use: [ExtractCssChunks.loader, "css-loader", "sass-loader"]
}
]
},
optimization: {
minimizer: [
new UglifyJsPlugin({
uglifyOptions: {
output: {
comments: false,
ascii_only: true
},
compress: {
comparisons: false
}
}
})
]
},
plugins: [
new ExtractCssChunks({
// Options similar to the same options in webpackOptions.output
// both options are optional
filename: "[name].css",
chunkFilename: "[id].css",
hot: true, // if you want HMR - we try to automatically inject hot reloading but if it's not working, add it to the config
orderWarning: true, // Disable to remove warnings about conflicting order between imports
reloadAll: true, // when desperation kicks in - this is a brute force HMR flag
cssModules: true // if you use cssModules, this can help.
})
]
};