-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwebpack.config.js
40 lines (38 loc) · 1002 Bytes
/
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
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlWebpackInlineSourcePlugin = require( 'html-webpack-inline-source-plugin' );
const path = require('path');
module.exports = {
entry: './assets-src/editor.js',
output: {
filename: 'editor.js',
path: path.resolve( __dirname, 'assets/editor' ),
},
performance: {
hints: false,
},
plugins: [
new HtmlWebpackPlugin( {
inlineSource: '.(js|css)$',
filename: 'editor.html',
template: 'assets-src/editor.html',
minify: {
collapseWhitespace: true,
minifyCSS: true,
removeComments: true,
removeRedundantAttributes: true,
removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true,
useShortDoctype: true,
},
} ),
new HtmlWebpackInlineSourcePlugin(),
// Remove the unused JS file.
new CleanWebpackPlugin( {
protectWebpackAssets: false,
cleanAfterEveryBuildPatterns: [
'*.js',
],
} ),
],
};