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 <git@herrmehren.de>
This commit is contained in:
David Mehren 2023-06-04 20:10:12 +02:00
parent 36cc55ae8e
commit acf24a1dd2
2 changed files with 4 additions and 9 deletions

View file

@ -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('<script src="../../plugin/markdown/marked.js"></script>', '<script>var exports = {};</script><script src="../../plugin/markdown/marked.js"></script>')
}
to: 'reveal.js/plugin'
}
]
}),

View file

@ -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({})
]