-
Notifications
You must be signed in to change notification settings - Fork 14
/
webpack.config.js
34 lines (33 loc) · 961 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
const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const WebpackShellPlugin = require('webpack-shell-plugin-next');
require('style-loader')
require('css-loader')
require('sass-loader')
module.exports = {
mode: 'development',
entry: ['./source/sass/2017/style.scss'],
output: {
path: path.resolve(__dirname, 'source/css'),
filename: 'bundle.css'
},
plugins: [
new MiniCssExtractPlugin(),
new WebpackShellPlugin({ onBuildEnd: ['npx purgecss --output source/css/ --content ../../public/*.html ../../public/**/*.html source/js/*.js --css source/css/main.css'] })
],
module: {
rules: [
{
test: /\.s[ac]ss$/i,
use: [
// Creates `style` nodes from JS strings
MiniCssExtractPlugin.loader,
// Translates CSS into CommonJS
'css-loader',
// Compiles Sass to CSS
'sass-loader',
],
},
],
},
};