Skip to content
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: ng webpack default import #8688

Merged
merged 1 commit into from
Feb 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,15 @@
},
"exports": {
".": {
"import": "./index.mjs",
"require": "./index.js"
"node": {
"import": "./index.mjs",
"require": "./index.js"
},
"browser": {
"require": "./index.js",
"import": "./browser/index.js",
"default": "./index.js"
}
},
"./browser": "./browser/index.js",
"./*.js": "./*.js",
Expand All @@ -24,7 +31,6 @@
"main": "./index.js",
"module": "./index.mjs",
"types": "./index.d.ts",
"type": "commonjs",
Copy link
Contributor Author

@giladgd giladgd Feb 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nodejs documentation encourages to explicitly specify "type": "commonjs" for CommonJS modules to be future-proof, currently not explicitly specifying it works exactly the same on nodejs and there are no plans to change that behavior at the moment.
However, this seems to break Webpack's module-system resolver at the moment, and until this is fixed at Webpack's end, it would be better to remove it for now.

"browser": {
"./browser/connection/ConnectionOptionsReader.js": "./browser/platform/BrowserConnectionOptionsReaderDummy.js",
"./browser/connection/options-reader/ConnectionOptionsXmlReader.js": "./browser/platform/BrowserConnectionOptionsReaderDummy.js",
Expand Down