Skip to content
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

fix(shiki): enable WASM on CF deployment #167

Merged
merged 4 commits into from Mar 19, 2024
Merged

fix(shiki): enable WASM on CF deployment #167

merged 4 commits into from Mar 19, 2024

Conversation

farnabaz
Copy link
Collaborator

No description provided.

@farnabaz farnabaz merged commit 6ee3552 into main Mar 19, 2024
2 checks passed
@adamdehaven
Copy link
Contributor

🎉 @farnabaz - when this is released I can pull it in and verify in our app; thanks for the update!

Copy link
Collaborator Author

You can check this using edge version. Add "@nuxtjs/mdc": "npm:@nuxtjs/mdc-edge@latest" to your package.json

@adamdehaven
Copy link
Contributor

@farnabaz I think there's still a missing internal configuration and/or missing piece of documentation. When deploying to Cloudflare Pages, I still need to define shiki/onig.wasm to my externals in my nuxt.config:

vite: {
  build: {
    rollupOptions: {
      external: [
        'shiki/onig.wasm',
      ],
    },
  },
}

If I exclude this from my build settings, I still get an error in the build step:
could not load wasm error

Could the addWasmSupport util you added also push the shiki/onig.wasm entry to the vite.build.rollupOptions.external array if it doesn't exist? Otherwise, I think this needs to be added to the docs.

@adamdehaven
Copy link
Contributor

@farnabaz any chance a new release could be published on the @latest channel with these changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants