Skip to content

Commit a6d3ac6

Browse files
committed
Upgrade to Webpack 4 - fix 'export as html' chunk
Signed-off-by: David Mehren <[email protected]>
1 parent 29a3813 commit a6d3ac6

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

webpack.production.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
var baseConfig = require('./webpackBaseConfig')
22
var webpack = require('webpack')
33
var path = require('path')
4-
var ExtractTextPlugin = require('extract-text-webpack-plugin')
5-
var OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin')
4+
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin')
65
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
76
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
87

@@ -35,6 +34,9 @@ module.exports = [Object.assign({}, baseConfig, {
3534
// baseUrl: '<%- url %>'
3635
}
3736
}), {
37+
// This Chunk is used in the 'save as html' feature.
38+
// It is embedded in the html file and contains CSS for styling.
39+
3840
entry: {
3941
htmlExport: path.join(__dirname, 'public/js/htmlExport.js')
4042
},
@@ -50,10 +52,17 @@ module.exports = [Object.assign({}, baseConfig, {
5052
'NODE_ENV': JSON.stringify('production')
5153
}
5254
}),
53-
new ExtractTextPlugin('html.min.css'),
54-
new OptimizeCssAssetsPlugin(),
55-
new MiniCssExtractPlugin()
55+
new MiniCssExtractPlugin({
56+
filename: 'html.min.css'
57+
})
5658
],
59+
60+
optimization: {
61+
minimizer: [
62+
new OptimizeCSSAssetsPlugin({})
63+
]
64+
},
65+
5766
module: {
5867
rules: [{
5968
test: /\.css$/,

0 commit comments

Comments
 (0)