-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
33 lines (32 loc) · 970 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
const { resolve } = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
module.exports = {
mode: 'development',
devtool: 'source-map',
entry: {
technote: [
'./src/assets/styles/technote.scss',
'./src/assets/scripts/technote.js',
],
},
output: {
filename: 'scripts/[name].js',
path: resolve(__dirname, 'src/technote/theme/static'),
},
plugins: [new MiniCssExtractPlugin({ filename: 'styles/[name].css' })],
optimization: { minimizer: [`...`, new CssMinimizerPlugin()] },
module: {
rules: [
{
test: /\.(scss|css)$/i,
use: [
MiniCssExtractPlugin.loader,
{ loader: 'css-loader', options: { sourceMap: true } },
{ loader: 'postcss-loader', options: { sourceMap: true } },
{ loader: 'sass-loader', options: { sourceMap: true } },
],
},
],
},
};