-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
fix: es6 module import #3858
fix: es6 module import #3858
Conversation
acf07fb
to
c0be5a8
Compare
Status
|
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.
Changing module
config to node16
adds ECMAScript support to TS, while still emitting CommonJS
(provided type
property in package.json
is not set to module
): https://www.typescriptlang.org/tsconfig#node16nodenext-nightly-builds
^ also changes the default value of moduleResolution
to node16
, which is the recommended way for Node.js v12+: https://www.typescriptlang.org/tsconfig#moduleResolution
Additional discussion on the issue solved by this PR: microsoft/TypeScript#43329
The flaky test failing continuously in this PR is fixed in #3865. |
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.
In microsoft/TypeScript#43329 (comment), the OP discusses a problem that could be caused by using a bundler. I tested this issue with vite-plugin-nightwatch
as we currently using Vite, and found that it works without any problems. Since we are transpiling and distributing it, we are in a safe position, and the aforementioned problem does not affect us.
As far as I understand from the issue linked in the comment shared above (especially the "Bundling with Webpack, esbuild, or Vite" section), the OP is talking about some discrepancy between how TypeScript and various bundlers resolve a package (being imported using |
closes #3859
Thanks in advance for your contribution. Please follow the below steps in submitting a pull request, as it will help us with reviewing it quicker.
features/my-new-feature
orissue/123-my-bugfix
);