Skip to content

Commit

Permalink
fix: dont externalize mermaid (#1033)
Browse files Browse the repository at this point in the history
[![PR App][icn]][demo] | Fix RM-XYZ
:-------------------:|:----------:

## 🧰 Changes

Don't externalize `mermaid` for the node build.

In `mdx-renderer` it's dynamically imported, so it doesn't usually get
executed. If we externalize it, we either have to specifically include
it in the execution environment, or configure rollup to inline it. The
former is an unnecessary hassle, and the latter appears to execute the
code immediatelly and slow down the build. So lets go back to bundling
it, but dynamically importing it.

## 🧬 QA & Testing

- [Broken on production][prod].
- [Working in this PR app][demo].


[demo]: https://markdown-pr-PR_NUMBER.herokuapp.com
[prod]: https://SUBDOMAIN.readme.io
[icn]:
https://user-images.githubusercontent.com/886627/160426047-1bee9488-305a-4145-bb2b-09d8b757d38a.svg
  • Loading branch information
kellyjosephprice authored Nov 21, 2024
1 parent 8d05b7a commit 030c4e6
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,6 @@ const serverConfig = merge(getConfig({ target: 'node' }), {
filename: '[name].node.js',
},
externals: {
'@readme/variable': '@readme/variable',
'@tippyjs/react': '@tippyjs/react',
mermaid: 'mermaid',
react: {
amd: 'react',
commonjs: 'react',
Expand Down

0 comments on commit 030c4e6

Please sign in to comment.