-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathwebpack.docs.js
54 lines (53 loc) · 1.15 KB
/
webpack.docs.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
const path = require('path');
const { merge } = require('webpack-merge');
const TerserPlugin = require('terser-webpack-plugin');
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');
module.exports = () => merge(require('./webpack.common.js')(), {
mode: 'production',
output: {
path: path.resolve(__dirname, 'docs/dist'),
clean: true,
},
optimization: {
minimizer: [
new TerserPlugin({
extractComments: false,
terserOptions: {
output: {
comments: false,
},
},
}),
new CssMinimizerPlugin({
minimizerOptions: {
preset: [
'default', {
discardComments: {
removeAll: true,
},
},
],
},
}),
],
},
plugins: [
new CopyPlugin({
patterns: [
{
from: '*',
context: 'docs',
}, {
from: 'docs/assets',
to: 'assets',
globOptions: {
ignore: [
'src',
],
},
},
],
}),
],
});