-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
refactor: Simplify package manifest config #1
refactor: Simplify package manifest config #1
Conversation
@@ -19,23 +19,18 @@ | |||
"license": "MIT", | |||
"files": ["dist", "src"], | |||
"source": "src/index.ts", | |||
"module": "./dist/index.module.js", |
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.
package.json#module
is only used by bundlers, very unlikely anyone will be using this and if they do, package.json#exports
is higher priority anyways in every bundler for the past 3+ years.
Can add it if you want, but will probably never see use.
"import": { | ||
"types": "./dist/index.d.ts", | ||
"default": "./dist/index.module.js" | ||
}, | ||
"require": { | ||
"types": "./dist/index.d.ts", | ||
"default": "./dist/index.cjs" | ||
} | ||
} |
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.
Unless you're shipping separate types for CJS and ESM (which Microbundle won't generate, though I don't think your interface needs it anyhow), there's no reason to nest like this.
}, | ||
"scripts": { | ||
"build": "microbundle --target node --sourcemap false --format cjs,esm" | ||
"build": "microbundle --target node --sourcemap false --format cjs,modern" |
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.
esm
is ES5, switching to modern
saves a tiny bit of build time (fewer transforms) and is completely safe behind package.json#exports
. If you do want to use package.json#module
for some reason, it could make sense to switch this back to esm
in the unlikelihood this plugin is used in an env that existed between 2015-2017.
Thank you for your contribution! |
No description provided.