-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
91 lines (90 loc) · 2.42 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
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
86
87
88
89
90
91
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
module.exports = {
target: 'web',
entry: {
index: './src/index/index.js',
courses: './src/courses/courses.js',
about: './src/about/about.js',
arithmetic: './src/uoar1/arithmetic/arithmetic_wrapper.js',
converter: './src/uoar1/converter/converter_wrapper.js',
error_correction: './src/uoar1/error_correction/error_correction_wrapper.js',
ieee754: './src/uoar1/ieee754/ieee754_wrapper.js',
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'js/[name].bundle.js'
},
module: {
rules: [
{
test: /\.(css|scss)$/,
use: [
MiniCssExtractPlugin.loader,
"css-loader",
"sass-loader"
]
}
]
},
devServer: {
port: 8080
},
plugins: [
new CleanWebpackPlugin(),
new HtmlWebpackPlugin({
template: 'src/index/index.html',
inject: true,
chunks: ['index'],
filename: 'index.html'
}),
new HtmlWebpackPlugin({
template: 'src/courses/courses.html',
inject: true,
chunks: ['courses'],
filename: 'courses.html'
}),
new HtmlWebpackPlugin({
template: 'src/about/about.html',
inject: true,
chunks: ['about'],
filename: 'about.html'
}),
new HtmlWebpackPlugin({
template: 'src/uoar1/arithmetic/arithmetic.html',
inject: true,
chunks: ['arithmetic'],
filename: 'uoar1/arithmetic.html'
}),
new HtmlWebpackPlugin({
template: 'src/uoar1/converter/converter.html',
inject: true,
chunks: ['converter'],
filename: 'uoar1/converter.html'
}),
new HtmlWebpackPlugin({
template: 'src/uoar1/error_correction/error_correction.html',
inject: true,
chunks: ['error_correction'],
filename: 'uoar1/error_correction.html'
}),
new HtmlWebpackPlugin({
template: 'src/uoar1/ieee754/ieee754.html',
inject: true,
chunks: ['ieee754'],
filename: 'uoar1/ieee754.html'
}),
new MiniCssExtractPlugin({
filename: 'css/[name].css',
chunkFilename: '[id].css',
}),
new CopyWebpackPlugin({
patterns: [
{ from: 'src/images', to: 'images' }
]
})
]
};