-
-
Notifications
You must be signed in to change notification settings - Fork 143
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
mjs causes trouble #7
Comments
Wow, what a nightmare. I swear they keep changing their resolution alg & how they treat ESM & |
Heh. I like |
Thanks for fast feedback! |
Had that initially – making a (lame attempt) statement for Thanks for raising the issue 🙇 |
I would wait til mjs will become stable. Ideally we should all move to https://github.com/standard-things/esm |
It was stable – webpack changed their behavior/treatment. IIRC it was masked in CRA uproar, but CRA changed their behavior only because webpack did. Ideally we wouldn't need |
Please, let me know when it will be published |
@dmtrKovalenko It already is :) version 1.0.3 |
Agreed we don't need |
@alekseykulikov @lukeed esm allows to not transpile commonjs to esm in pure module bundler like rollup. |
@alekseykulikov clsx had the same setup as htm has. Try to tell everybody it's their problem. I'd say mjs is not ready for use. |
@TrySound you point the issue with webpack, that should be addressed by Could you point why webpack decided to change the resolution algorithm from node? |
Webpack needs this config to make rules: [{
test: /\.m?jsx?$/,
type: 'javascript/auto',
}] This tells webpack to treat it like everything else. I'm not sure why webpack has done this. It's frustrating tbh. I would much rather use |
@alekseykulikov But you have to add experimental-modules flag. Is it shorter? And you have to use ugly mjs extension. It's made mostly for dual mode which fails with webpack. That's why I would wait until it become stable. |
Just wrapped it up into a plugin: |
Webpack has an opinion to not resolve mjs from non mjs packages.
reactjs/react-transition-group#77 (comment)
However you enforced it via
module
field and webpack becomes crazy about it.We got this issue mui/material-ui-pickers#894
I propose to get rid from mjs in favour of just stable module field which can be safely resolved by webpack.
The text was updated successfully, but these errors were encountered: