-
-
Notifications
You must be signed in to change notification settings - Fork 394
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
[BUG] when using "type": "module"
in root package.json and convert svelte.config.js
to ESM, plasmo errors requiring this file
#364
Comments
after looking at this one a bit further, it appears this issue resides with parcel https://github.com/parcel-bundler/parcel/blob/50f8cc2979f0efafce30305ffd3c08a88a26ccf3/packages/core/utils/src/config.js#L77 |
So technically, we do not have to use Parcel's config loader thingy at all in our plugin. We can just parse it ourselves in the config resolver with some modern esm/mjs/ts config file parser even (that's used by vite). |
@louisgv agreed, that makes sense. I opened a PR with parcel to (hopefully) resolve this issue, and will close this since it is related to a dependency |
I would be very interested in a Vite setup |
IMO, Vite is for web bundling. There's the crxjs suite of esbuild plugin that enable extension but afaik, the perf between vite (esbuild based) vs parcel 2 (SWC based), is largely the same - they both bundle the code and skip the type checking process. What parcel offers out of the box is much more powerful than vite for customizing the bundler - which is why I chose it for Plasmo. Its plugin system allows tapping into almost every aspect of the build, and it has a lot of pre-built plugins for different ui frameworks and file extensions. This allows Plasmo to focus on enhancing the DX further, and not having to worry too much about dealing with the bundler (i.e, Plasmo supports Tailwinds and almost any css-in-js out of the box, etc...) Tho, Plasmo and vite should works well together in the same repo, the same as nextjs and vite. Plasmo goal is not to be the bundle, it's to enhance the DX with more powerful API such as messaging and declarative module creation. |
What happened?
when using
"type": "module"
in root package.json and convertsvelte.config.js
to ESM, plasmo errors requiring this filepnpm create plasmo --with-svelte
"type": "module"
to project root'spackage.json
svelte.config.js
to ESM (i.e.... export default {}
pnpm build
Version
Latest
What OS are you seeing the problem on?
MacOSX
What browsers are you seeing the problem on?
No response
Relevant log output
No response
(OPTIONAL) Contact Details
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: