-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathwebpack.config.js
More file actions
85 lines (84 loc) · 2.11 KB
/
webpack.config.js
File metadata and controls
85 lines (84 loc) · 2.11 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const path = require('path');
module.exports = {
mode: 'development',
entry: {
index: './src/js/index.js',
about: './src/js/about.js',
workshops: './src/js/workshops.js',
workshop: './src/js/workshop.js',
build: './src/js/build.js',
404: './src/js/404.js'
},
output: {
path: path.resolve('dist')
},
module: {
rules: [
{
test: /\.scss$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
options: {}
},
'css-loader', // translates CSS into CommonJS
'sass-loader' // compiles Sass to CSS, using Node Sass by default
]
},
{
test: /\.(png|jpg|jpeg|svg)$/,
include: path.join(__dirname, 'src/static/img'),
loader: 'url-loader'
}
]
},
plugins: [
new HtmlWebpackPlugin({
template: './src/index.html',
filename: 'index.html',
chunks: ['index']
}),
new HtmlWebpackPlugin({
template: './src/about.html',
filename: 'about/index.html',
chunks: ['about']
}),
new HtmlWebpackPlugin({
template: './src/workshops.html',
filename: 'workshops/index.html',
chunks: ['workshops']
}),
new HtmlWebpackPlugin({
template: './src/workshop.html',
filename: 'workshop/index.html',
chunks: ['workshop']
}),
new HtmlWebpackPlugin({
template: './src/build.html',
filename: 'build/index.html',
chunks: ['build']
}),
new HtmlWebpackPlugin({
template: './src/register.html',
filename: 'register/index.html',
chunks: ['register']
}),
new HtmlWebpackPlugin({
template: './src/404.html',
filename: '404.html',
chunks: ['404']
}),
new CopyWebpackPlugin([{ from: 'src/static' }]),
new MiniCssExtractPlugin({
filename: '[name].css'
})
],
devServer: {
port: 3039,
contentBase: 'src/static',
publicPath: '/'
}
};