-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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 node13 #2451
Support node13 #2451
Conversation
Size Change: 0 B Total Size: 39.2 kB ℹ️ View Unchanged
|
I think I would prefer to try |
I wouldn't mind trialing it |
That route also feels more right to me but iirc that broke CJS consumers when I tried it, because Node will import the CJS entry point but try to parse it as an ES Module. |
@@ -28,6 +29,12 @@ | |||
"require": "./debug/dist/debug.js", | |||
"import": "./debug/dist/debug.module.js" | |||
}, | |||
"./devtools": { | |||
"browser": "./devtools/dist/devtools.module.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch about the missing devtools package 👍 💯
@nsivertsen I think we could potentially get around that by renaming the commonjs entry modules to |
@developit Yeah, I feared that might cause similar problems for tooling as using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! I'm glad to see those pesky compatibility issues being gone 🙌 Great work all around 💯
Creates conditional export that points "import" conditional exports to mjs files. This lets node load the esm version with having to set "type": "module" on the main package.json. This is similar to the approach in the main preact repo - preactjs/preact#2451
Creates conditional export that points "import" conditional exports to mjs files. This lets node load the esm version with having to set "type": "module" on the main package.json. This is similar to the approach in the main preact repo - preactjs/preact#2451
Creates conditional export that points "import" conditional exports to mjs files. This lets node load the esm version with having to set "type": "module" on the main package.json. This is similar to the approach in the main preact repo - preactjs/preact#2451
In node v13 we either need to end our modular file in
.mjs
or have amodule: true
entry in our package json to resolve as a module