-
Type:
Sub-task
-
Resolution:
Fixed
-
Priority:
Unknown
-
-
Affects Version/s:
None
-
Component/s:
None
-
-
-
Not Needed
-
Not Needed
Acceptance Criteria
Implementation Requirements
- Update rollup
- change the script to output 3 bundles:
- dist/bson.cjs - commonjs module, one shared file for all of bson used by node
- dist/bson.mjs - esm module, one shared file for all of bson used by bundlers for web (Rename: dist/bson.esm.js)
- dist/bson.bundle.js - Legacy style script that puts exports on the global object (CDN style)
- Ensure all bundles have corresponding source maps that do not inline the source
- Ensure the lib directory is no longer shipped in the npm package
- Set the "exports" field in the package.json:
- "import": "./dist/bson.mjs"
- "require": "./dist/bson.cjs"
- set "main": "./dist/bson.cjs"
Testing Requirements
- Unit tests that make sure the exports are equal could be applicable
- Test a default webpack setup to see if bundling still works