Skip to content
Branch: master
Find file History
Latest commit 3757d5b Oct 25, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.



npm i -D @db-scripts/bundle


Add this to your package.json

  "scripts": {
    "build": "db-scripts-bundle --size-snapshot",

This will create an ES Module build, a commonjs build, a umd build and an esnext build within a dist folder.

Typically you want to add these fields to your package.json

  "main": "dist/cjs/index.js",
  "module": "dist/es/index.js",
  "sideEffects": false,
  "files": [

Check out the docs for sideEffects to make sure you understand what this field implies.

The bundling process uses plain babel for the esm and commonjs builds. You can find the reasoning here.


The scripts are very heavily inspired by kcd-scripts. Thanks a lot for sharing your code Kent!

You can’t perform that action at this time.