mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2026-06-23 04:10:17 +00:00
c489497e45
This change removes the meta-marked dependency which solely was used for extracting the frontmatter, which is possible as well with one function. Furthermore, this introduces constraints to objects resulting from frontmatter parsing and enforces them in order to prevent attacks like a yaml bomb (massive alias expansion). This change should resolve a possible DoS attack. Signed-off-by: Erik Michelson <github@erik.michelson.eu>
42 lines
1.1 KiB
JavaScript
42 lines
1.1 KiB
JavaScript
const common = require('./webpack.common.js')
|
|
const htmlexport = require('./webpack.htmlexport')
|
|
const { merge } = require('webpack-merge')
|
|
const path = require('path')
|
|
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin')
|
|
const { EsbuildPlugin } = require('esbuild-loader')
|
|
|
|
module.exports = [
|
|
merge(common, {
|
|
mode: 'production',
|
|
output: {
|
|
path: path.join(__dirname, 'public/build'),
|
|
publicPath: 'build/',
|
|
filename: '[name].[contenthash].js'
|
|
},
|
|
optimization: {
|
|
minimizer: [
|
|
new EsbuildPlugin({
|
|
target: 'es2015',
|
|
format: 'cjs',
|
|
exclude: ['MathJax/extensions/a11y/mathmaps', 'reveal.js/plugin/markdown/marked.js', 'constrain-object.min.js']
|
|
})
|
|
],
|
|
splitChunks: {
|
|
chunks: 'all'
|
|
}
|
|
},
|
|
devtool: 'source-map'
|
|
}),
|
|
merge(htmlexport, {
|
|
mode: 'production',
|
|
optimization: {
|
|
minimizer: [
|
|
new EsbuildPlugin({
|
|
target: 'es2015',
|
|
format: 'cjs'
|
|
}),
|
|
new OptimizeCSSAssetsPlugin({})
|
|
]
|
|
}
|
|
})]
|