-
Notifications
You must be signed in to change notification settings - Fork 450
Migrate from CJS to ESM #9596
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
base: main
Are you sure you want to change the base?
Migrate from CJS to ESM #9596
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
797147e to
28fb4df
Compare
11608e1 to
2674c07
Compare
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
0f3403d to
efb3d0f
Compare
olmoh
left a comment
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.
Nice job, tested and works fine on macOS, LGTM.
efb3d0f to
704ee07
Compare
a28a7ab to
9e8fc26
Compare
After migrating the project to ESM the .mjs extension is used for the built preload file, however we want to retain the .js extension.
When the @vitejs/plugin-react package was updated it was no longer compatible with the TS config's `moduleResolution` setting, as such the TS config had to be updated. `moduleResolution` has to changed to `bundler`, and because of that we can no longer target `commonjs` as the output format. As such we also had to bump the `module` config option to `es2022`. With these changes in mind it made sense to also bump the TS target to `es2022` from `es2021`. The emitted code built by typescript is now a lot more modern than in previous builds.
This was previously done by the @vitejs/plugin-react package but must now be done manually.
Node now has the ability to run typescript code natively.
Since version 22.19 node natively supports executing typescript files.
49bfc50 to
4266ac9
Compare
4266ac9 to
e10f941
Compare
Note: This PR is based on #9633
This change is