Skip to content

Commit 3620ef8

Browse files
edanielsmbroadst
authored andcommitted
fix(rollup): fixup dist and bundle in Buffer
Improves support for Angular 6, React Native, etc by diversifying our generated bundles and including an informative dependency on the buffer polyfill.
1 parent 6b49c23 commit 3620ef8

27 files changed

+5389
-5383
lines changed

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@ npm-debug.log
1313
builderror.log
1414

1515
bson.sublime-project
16-
bson.sublime-workspace
16+
bson.sublime-workspace
17+
18+
dist/*
19+
!/dist/bson.bundle.js

README.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ npm run build
1818
A simple example of how to use BSON in the browser:
1919

2020
```html
21-
<script src="./dist/bson.js"></script>
21+
<script src="./dist/bson.bundle.js"></script>
2222

2323
<script>
2424
function start() {
@@ -166,3 +166,10 @@ const obj = { answer: new CustomSerialize() };
166166
// "{ answer: 42 }"
167167
console.log(bson.deserialize(bson.serialize(obj)));
168168
```
169+
170+
#### What are the various files in dist?
171+
172+
* `bson.bundle.js` is a bundled up version of the library that is suitable for inclusion in an HTML page via a `<script>` tag.
173+
* `bson.esm.js` is a rolled up version of the library that is suitable for interoperation with bundlers that work better with ES modules.
174+
* `bson.browser.esm.js` is similar to `bson.esm.js` but is ultimately intened for consumers producing browser bundles. It also pulls in any browser specific dependencies/code that may be needed.
175+
* `bson.browser.umd.js` is similar to the source code of this library but is ultimately intened for consumers producing browser bundlers expecting a UMD format. It also pulls in any browser specific dependencies/code that may be needed.

0 commit comments

Comments
 (0)