-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
29 lines (28 loc) · 1.06 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
/* eslint-disable global-require */
const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const CopyPlugin = require('copy-webpack-plugin');
module.exports = {
mode: 'production',
entry: {
home: ['./public/src/scss/home.scss', './public/src/js/home.js'],
subjects: ['./public/src/scss/subjects.scss', './public/src/js/subjects.js'],
'manage-subject': ['./public/src/js/manage-subject.js'],
'get-started': ['./public/src/scss/get-started.scss', './public/src/js/get-started.js'],
},
output: {
path: path.resolve(__dirname, 'public', 'dist'),
filename: '[name].js',
},
module: {
rules: [{
test: /\.(scss)$/,
use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader'],
}],
},
plugins: [new MiniCssExtractPlugin({
filename: '[name].css',
}), new CopyPlugin({
patterns: [{ from: path.resolve(__dirname, 'public', 'src', 'images'), to: path.resolve(__dirname, 'public', 'dist', 'images') }],
})],
};