-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: wasm configuration #165
Conversation
```ts [nuxt.config.ts] | ||
export default defineNuxtConfig({ | ||
modules: ['@nuxtjs/mdc'], | ||
$production: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, I'd like to see if it's possible to leave the wasm
enabled for $development
as well?
See the errors when running this reproduction's dev server: https://github.com/adamdehaven/mdc-wasm-monorepo
nitro: { | ||
// Enable the wasm feature in production for the Shiki syntax highlighter | ||
experimental: { | ||
wasm: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, mdc module already has built-in logic to add wasm related logic. it should not be required unless that current mdc logic is outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't seem to be handled properly (?) in a Nuxt project deployed to Cloudflare Pages without this setting.
If you check the reproduction deploys in this comment you'll see two things are missing:
- The
nitropack
version needed to be bumped to2.9.x
- Without the
nitro.experimental.wasm: true
setting, the syntax highlighting is still not functional.
Let me know if you want me to update one of the reproduction repos/branches?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 149 in 420a502
useWasmAssets: !nuxt.options.dev && !!nuxt.options.nitro.experimental?.wasm |
The way I'm reading this line, I believe the setting is required? Feel free to correct me 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pi0 I modified my local @nuxtjs/mdc
build and changed the line referenced above to this (removing the check for the nitro.experimental.wasm: true
setting):
useWasmAssets: !nuxt.options.dev
If I remove the line, I can then remove the nitro.experimental.wasm: true
in my host project, and things work as expected as long as I list shiki/onig.wasm
in the vite.build.rollupOptions.external
array.
Closing in favor of #167 |
Add documentation around the
wasm
support needed for the default Shiki syntax highlighter.