[BUG]: useless field in package.json
See original GitHub issuePackage Scope
Package name: all package
Describe the bug
{
"name": "@toss/assert",
"version": "1.0.4",
"sideEffects": false,
"exports": {
".": {
"require": "./src/index.ts",
"import": "./src/index.ts"
},
"./package.json": "./package.json"
},
"main": "src/index.ts",
"scripts": {
},
"dependencies": {
"@toss/utils": "workspace:^1.0.4"
},
"devDependencies": {
"typescript": "4.8.3"
},
"publishConfig": {
"access": "public",
"exports": {
".": {
"require": "./dist/index.js",
"import": "./esm/index.mjs",
"types": "./dist/index.d.ts"
},
"./package.json": "./package.json"
},
"import": "./esm/index.mjs", // here
"main": "dist/index.js",
"module": "./esm/index.mjs",
"types": "dist/index.d.ts"
},
"gitHead": "..."
}
I think "import": "./esm/index.mjs",
field is not official field, and not used in anywhere.
I checked this in node and npm. But I couldn’t find any explanation about the field.
It seems that even webpack and rollup are not using “import” field of package.json.
What’s the purpose of the “import” field ?
Check please 😄
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
[Bug]: The imports field in package.json is ignored #12994
My project uses chalk that uses imports field, and jest on my project fails on that error. package.json: "imports": { "#ansi-styles": "./source/ ...
Read more >npm WARN package.json: No repository field
It's just a check as of NPM v1.2.20, they report this as a warning. However, don't worry, there are sooooooo many packages which...
Read more >When not to use package-lock.json
The state of dependencies should be described in package.json. That's what the dependencies field is for. Package-lock.json is unnecessary.
Read more >API - esbuild
This changes how the exports field in package.json files is interpreted to prefer node-specific code. If no custom conditions are configured, the Webpack- ......
Read more >Why you should use package-lock.json
In this article, we'll look at package-lock.json , why it's important, and how it's best used along with NPM CLI in your day-to-day...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We should remove all import fields in our package.json.
OK 😄