You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This will simplify the workflow for Node consumers. Instead of CJS (CommonJS) directly importing the CJS bundle, they can use a regular bare import. Ex const absurdum = require('absurdum').
BREAKING Experimental
This changes the meaning of pkg.main. Instead of pointing to the ESM entry-point, it can be reassigned to the CJS bundle for backward compat with <13.2 Node.
New Entry Points
The new pkg.exports rollout also includes the ability to assign Conditional Exports. In short, entry points can be defined to allow importing of the arrays, objects, strings groups directly.
Why? A limitation or Webpack's tree-shaking is that it doesn't work with export * as ns style re-exports. It won't eliminate unused parts when the main entry point is used.
This will also enable named exports from each group in ESM
import{without}from'absurdum/arrays';
Changes
1.x
add pkg.engines -> node >= 13.2
add CHANGELOG.md
2.x
remove pkg.module
change pkg.engines -> node >= 13.7
remove 'CommonJS' section from README.md
add *.cjs bundles for arrays, objects, strings
update CHANGELOG.md with notes on the breaking change
add 'Webpack' section to README.md
add 'Legacy' section to README.md
Add namespace-specific exports for ESM
Update README.md w/ an notice for Node users?
Update tests to rely on self-referencing import specifiers
Node 13.7 introduced the new
pkg.exports
proposalThis will simplify the workflow for Node consumers. Instead of CJS (CommonJS) directly importing the CJS bundle, they can use a regular bare import. Ex
const absurdum = require('absurdum')
.BREAKING Experimental
This changes the meaning of
pkg.main
. Instead of pointing to the ESM entry-point, it can be reassigned to the CJS bundle for backward compat with <13.2 Node.New Entry Points
The new
pkg.exports
rollout also includes the ability to assign Conditional Exports. In short, entry points can be defined to allow importing of the arrays, objects, strings groups directly.Why? A limitation or Webpack's tree-shaking is that it doesn't work with
export * as ns
style re-exports. It won't eliminate unused parts when the main entry point is used.This will also enable named exports from each group in ESM
Changes
1.x
node >= 13.2
2.x
pkg.module
node >= 13.7
add*.cjs
bundles for arrays, objects, stringsupdate CHANGELOG.md with notes on the breaking changeadd 'Webpack' section to README.mdadd 'Legacy' section to README.mdNotes
package.json
References
The text was updated successfully, but these errors were encountered: