You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
The text was updated successfully, but these errors were encountered:
Version: all
Details
Currently @marko/vite has issues around using
.marko
files from within thenode_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 thenode_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 atest
module with apackage.json
including{ "name": "test" }
and amarko.json
exposing some components as described here: https://markojs.com/docs/custom-tags/#publishing-tags-to-npmThe text was updated successfully, but these errors were encountered: