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

Support Marko node_module packages with commonjs dependencies. #12

Closed
DylanPiercey opened this issue Apr 3, 2022 · 1 comment · Fixed by #15
Closed

Support Marko node_module packages with commonjs dependencies. #12

DylanPiercey opened this issue Apr 3, 2022 · 1 comment · Fixed by #15
Labels

Comments

@DylanPiercey
Copy link
Contributor

Version: all

Details

Currently @marko/vite has issues around using .marko files from within the node_modules, especially if those .marko files go on to include commonjs modules. In Vite using commonjs is generally not supported, however when they are within the node_modules it is typically handled since these will be pre bundled and go through esbuild, which does support commonjs.

Possible Fix

Previously SFC frameworks like Svelte and Vue were hacking into Vite internals to work around this issue, however a recent feature in Vite should make it possible to prebundle .marko files, resolving this issue.

Vite Optimized Extensions PR: vitejs/vite#6801
Svelte Implementation of the above: https://github.com/sveltejs/vite-plugin-svelte/pull/294/files

Steps to reproduce

Probably the simplest way to reproduce is just to add a local node_modules folder relative to a component and add a test module with a package.json including { "name": "test" } and a marko.json exposing some components as described here: https://markojs.com/docs/custom-tags/#publishing-tags-to-npm

@github-actions
Copy link
Contributor

🎉 This issue has been resolved in version 2.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

1 participant