-
Notifications
You must be signed in to change notification settings - Fork 27
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
Use cjs
extension for cjs entrypoint
#72
Conversation
By using `"type": "module"` all cjs code needs to end with the correct extension. Currently trying to use parsel-js as cjs results in this error ``` ReferenceError: require is not defined in ES module scope, you can use import instead This file is being treated as an ES module because it has a '.js' file extension and '/home/lingga/selector-lint/package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension. at file:///home/lingga/selector-lint/test.js:1:16 at ModuleJob.run (node:internal/modules/esm/module_job:193:25) at async Promise.all (index 0) at async ESMLoader.import (node:internal/modules/esm/loader:530:24) at async loadESM (node:internal/process/esm_loader:91:5) at async handleMainPromise (node:internal/modules/run_main:65:12) ```
✅ Deploy Preview for parsel ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Hey, thank you for contributing! Fine with the change, though then we don't need a Any thoughts @jrandolf ? |
Changing the dist folder output can happen anytime, right now the entire library is unusable by anyone that needs to compile to cjs - which unfortunately includes webpack 🥲 |
cjs
extension for cjs entrypoingcjs
extension for cjs entrypoint
Sure, but isn't that a trivial change, since you're already working on this PR? |
Oh sure, didn't realize you were asking me to do it, throught you were starting a round of discussion 😅 Done in 2b149ac |
cjs
extension for cjs entrypointcjs
extension for cjs entrypoint
cjs
extension for cjs entrypointcjs
extension for cjs entrypoint
Nah, it was more a "any objections?" 😁 |
Updates entrypoints and export maps for cjs to
parsel.min.cjs
Fixes #73