Skip to content

Commit

Permalink
feat(rollup): switch from webpack to rollup for bundling
Browse files Browse the repository at this point in the history
  • Loading branch information
mbroadst committed Jun 13, 2018
1 parent b75bcf0 commit 98068fa
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 16,463 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ node_modules/

output
build
browser_build
.bin
npm-debug.log
builderror.log
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

BSON is short for Bin­ary JSON and is the bin­ary-en­coded seri­al­iz­a­tion of JSON-like doc­u­ments. You can learn more about it in [the specification](http://bsonspec.org).

This browser version of the BSON parser is compiled using [webpack](https://webpack.js.org/) and the current version is pre-compiled in the `browser_build` directory.
This browser version of the BSON parser is compiled using [rollup](https://rollupjs.org/) and the current version is pre-compiled in the `dist` directory.

This is the default BSON parser, however, there is a C++ Node.js addon version as well that does not support the browser. It can be found at [mongod-js/bson-ext](https:/mongodb-js/bson-ext).

Expand All @@ -18,7 +18,7 @@ npm run build
A simple example of how to use BSON in the browser:

```html
<script src="./browser_build/bson.js"></script>
<script src="./dist/bson.js"></script>

<script>
function start() {
Expand Down
2 changes: 1 addition & 1 deletion alternate_parsers/faster_bson.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// reduced to ~ 410 LOCs (parser only 300 vs. 1400+) with (some, needed) BSON classes "inlined".
/// Compare ~ 4,300 (22KB vs. 157KB) in browser build at: https:/mongodb/js-bson/blob/master/browser_build/bson.js
/// Compare ~ 4,300 (22KB vs. 157KB) in browser build at: https:/mongodb/js-bson/blob/master/dist/bson.js

module.exports.calculateObjectSize = calculateObjectSize;

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"parser"
],
"author": "Christian Amor Kvalheim <[email protected]>",
"main": "./browser_build/bson.js",
"main": "./dist/bson.js",
"license": "Apache-2.0",
"moduleType": [
"globals",
Expand Down
Loading

0 comments on commit 98068fa

Please sign in to comment.