-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.config.js
55 lines (46 loc) · 1.15 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
49
50
51
52
53
54
55
/*
The purpose of this file is a secondary build step, which compiles all styles
into a single css file, which can be passed to the production system.
*/
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const sassGlobImporter = require('node-sass-glob-importer');
const path = require('path');
const webpack = require('webpack');
module.exports = {
mode: 'production',
entry: {
styles: ['./node_modules/leaflet/dist/leaflet.css', './src/style.scss'],
'bundle.js': './static/javascript/init.js'
},
output: {
path: path.resolve(__dirname, 'public'),
filename: '[name]'
},
module: {
rules: [
{
test: /\.s?css$/,
use: [
MiniCssExtractPlugin.loader,
'css-loader?url=false',
'postcss-loader',
{
loader: 'sass-loader',
options: {
importer: sassGlobImporter(),
outputStyle: 'expanded'
}
}
]
}
]
},
plugins: [
new MiniCssExtractPlugin({
filename: 'style.css'
}),
new webpack.BannerPlugin({
banner: `Build: ${new Date().toString()}`
})
]
};