summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Mehren2018-07-03 22:47:50 +0200
committerDavid Mehren2018-09-06 17:26:09 +0200
commita6d3ac647b144341bedb1221fe65f0abd3d574d5 (patch)
tree32f53d56d42d0a920ef53d09d78d1317c4acfde0
parent29a3813adaa54adaafab1678e30d754ecf0c9e3b (diff)
Upgrade to Webpack 4 - fix 'export as html' chunk
Signed-off-by: David Mehren <dmehren1@gmail.com>
-rw-r--r--webpack.production.js19
1 files changed, 14 insertions, 5 deletions
diff --git a/webpack.production.js b/webpack.production.js
index 22093b1b..67387583 100644
--- a/webpack.production.js
+++ b/webpack.production.js
@@ -1,8 +1,7 @@
var baseConfig = require('./webpackBaseConfig')
var webpack = require('webpack')
var path = require('path')
-var ExtractTextPlugin = require('extract-text-webpack-plugin')
-var OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin')
+const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
@@ -35,6 +34,9 @@ module.exports = [Object.assign({}, baseConfig, {
// baseUrl: '<%- url %>'
}
}), {
+ // This Chunk is used in the 'save as html' feature.
+ // It is embedded in the html file and contains CSS for styling.
+
entry: {
htmlExport: path.join(__dirname, 'public/js/htmlExport.js')
},
@@ -50,10 +52,17 @@ module.exports = [Object.assign({}, baseConfig, {
'NODE_ENV': JSON.stringify('production')
}
}),
- new ExtractTextPlugin('html.min.css'),
- new OptimizeCssAssetsPlugin(),
- new MiniCssExtractPlugin()
+ new MiniCssExtractPlugin({
+ filename: 'html.min.css'
+ })
],
+
+ optimization: {
+ minimizer: [
+ new OptimizeCSSAssetsPlugin({})
+ ]
+ },
+
module: {
rules: [{
test: /\.css$/,