From acf24a1dd2e0ef3cfc15ba33c7a2380c9a531575 Mon Sep 17 00:00:00 2001 From: David Mehren Date: Sun, 4 Jun 2023 20:10:12 +0200 Subject: [PATCH] fix(esbuild): exclude reveal.js marked plugin https://github.com/hedgedoc/hedgedoc/pull/4114 did not properly fix the missing speaker notes. It turns out that by just excluding reveal.js/plugin/markdown/marked.js from esbuild processing, we can stop invalid JS from being generated. Signed-off-by: David Mehren --- webpack.common.js | 7 +------ webpack.prod.js | 6 +++--- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/webpack.common.js b/webpack.common.js index 60ff23d90..dd4de4e40 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -136,12 +136,7 @@ module.exports = { { context: path.join(__dirname, 'node_modules/reveal.js'), from: 'plugin', - to: 'reveal.js/plugin', - transform (content, path) { - // The marked.js script wants a 'exports' variable and is referenced from plugin/notes/notes.html - // we copy, so just patch that to give it one. - return content.toString().replace('', '') - } + to: 'reveal.js/plugin' } ] }), diff --git a/webpack.prod.js b/webpack.prod.js index 5a7914798..cacdf30ba 100644 --- a/webpack.prod.js +++ b/webpack.prod.js @@ -17,8 +17,8 @@ module.exports = [ minimizer: [ new EsbuildPlugin({ target: 'es2015', - format: "cjs", - exclude: ['MathJax/extensions/a11y/mathmaps'] + format: 'cjs', + exclude: ['MathJax/extensions/a11y/mathmaps', 'reveal.js/plugin/markdown/marked.js'] }) ], splitChunks: { @@ -33,7 +33,7 @@ module.exports = [ minimizer: [ new EsbuildPlugin({ target: 'es2015', - format: "cjs" + format: 'cjs' }), new OptimizeCSSAssetsPlugin({}) ]