-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
38 lines (37 loc) · 1010 Bytes
/
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
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const path = require('path');
module.exports = {
mode: 'production',
entry: {
index: './style/index.css'
},
output: {
path: path.resolve(__dirname, 'static'),
// we won't use these JS files, only the extracted CSS
filename: '[name].js'
},
module: {
rules: [
{ test: /\.css$/, use: [MiniCssExtractPlugin.loader, 'css-loader'] },
{
test: /\.svg/,
use: [
{ loader: 'svg-url-loader', options: {} },
{ loader: 'svgo-loader', options: { plugins: [] } }
]
},
{
test: /\.(png|jpg|gif|ttf|woff|woff2|eot)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
use: [{ loader: 'url-loader', options: { limit: 10000 } }]
}
]
},
plugins: [
new MiniCssExtractPlugin({
// Options similar to the same options in webpackOptions.output
// both options are optional
filename: '[name].css',
chunkFilename: '[id].css'
})
]
};