mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-25 11:16:31 -05:00
Upgrade to Webpack 4 - fix 'export as html' chunk
Signed-off-by: David Mehren <dmehren1@gmail.com>
This commit is contained in:
parent
29a3813ada
commit
a6d3ac647b
1 changed files with 14 additions and 5 deletions
|
@ -1,8 +1,7 @@
|
||||||
var baseConfig = require('./webpackBaseConfig')
|
var baseConfig = require('./webpackBaseConfig')
|
||||||
var webpack = require('webpack')
|
var webpack = require('webpack')
|
||||||
var path = require('path')
|
var path = require('path')
|
||||||
var ExtractTextPlugin = require('extract-text-webpack-plugin')
|
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin')
|
||||||
var OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin')
|
|
||||||
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
|
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
|
||||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
||||||
|
|
||||||
|
@ -35,6 +34,9 @@ module.exports = [Object.assign({}, baseConfig, {
|
||||||
// baseUrl: '<%- url %>'
|
// 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: {
|
entry: {
|
||||||
htmlExport: path.join(__dirname, 'public/js/htmlExport.js')
|
htmlExport: path.join(__dirname, 'public/js/htmlExport.js')
|
||||||
},
|
},
|
||||||
|
@ -50,10 +52,17 @@ module.exports = [Object.assign({}, baseConfig, {
|
||||||
'NODE_ENV': JSON.stringify('production')
|
'NODE_ENV': JSON.stringify('production')
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
new ExtractTextPlugin('html.min.css'),
|
new MiniCssExtractPlugin({
|
||||||
new OptimizeCssAssetsPlugin(),
|
filename: 'html.min.css'
|
||||||
new MiniCssExtractPlugin()
|
})
|
||||||
],
|
],
|
||||||
|
|
||||||
|
optimization: {
|
||||||
|
minimizer: [
|
||||||
|
new OptimizeCSSAssetsPlugin({})
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
module: {
|
module: {
|
||||||
rules: [{
|
rules: [{
|
||||||
test: /\.css$/,
|
test: /\.css$/,
|
||||||
|
|
Loading…
Reference in a new issue