-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
48 lines (47 loc) · 1.23 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
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const TerserPlugin = require('terser-webpack-plugin')
module.exports = {
mode: 'production',
entry: {
bundle: [
'./src/index.js',
'./src/lib/cross-document-references-macro.js', // Macro extensions
'./src/lib/git-macro.js',
'./src/lib/inter-document-references-macro.js',
'./src/lib/man-macro.js',
'./src/lib/packages-macro.js',
'./src/lib/sectnumoffset-treeprocessor.js',
],
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'build'),
},
optimization: {
minimize: false,
minimizer: [new TerserPlugin()],
},
plugins: [
new HtmlWebpackPlugin({
template: './public/index.html',
filename: 'index.html',
chunks: ['bundle'],
inject: 'body',
}),
new HtmlWebpackPlugin({
template: './public/pages/help.html',
filename: 'pages/help.html',
chunks: [],
}),
new CopyWebpackPlugin({
patterns: [
{ from: 'public/styles', to: 'styles' },
{ from: 'public/config.json', to: 'config.json' },
{ from: 'public/favicon.ico', to: 'favicon.ico' },
{ from: 'public/.nojekyll', to: '.nojekyll', toType: 'file'},
],
}),
],
}