Skip to content

Commit

Permalink
fix(esbuild): exclude reveal.js marked plugin
Browse files Browse the repository at this point in the history
#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>
  • Loading branch information
davidmehren committed Jun 4, 2023
1 parent 36cc55a commit acf24a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
7 changes: 1 addition & 6 deletions webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
]
}),
Expand Down
6 changes: 3 additions & 3 deletions webpack.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -33,7 +33,7 @@ module.exports = [
minimizer: [
new EsbuildPlugin({
target: 'es2015',
format: "cjs"
format: 'cjs'
}),
new OptimizeCSSAssetsPlugin({})
]
Expand Down

0 comments on commit acf24a1

Please sign in to comment.