@db-scripts/bundle
Bundling for my OS projects
Last updated 2 months ago by danielberndt .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @db-scripts/bundle 
SYNC missed versions from official npm registry.

@db-scripts/bundle

Installation

npm i -D @db-scripts/bundle

Usage

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.

It also will also add a .size-snapshot.json which will tell you the size of your library including all required dependencies.

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

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

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.

Thanks

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

Current Tags

  • 0.2.3                                ...           latest (2 months ago)

6 Versions

  • 0.2.3                                ...           2 months ago
  • 0.2.2                                ...           2 months ago
  • 0.2.1                                ...           2 months ago
  • 0.1.2                                ...           2 months ago
  • 0.1.1                                ...           a year ago
  • 0.1.0                                ...           a year ago
Maintainers (1)
Downloads
Today 6
This Week 6
This Month 6
Last Day 0
Last Week 0
Last Month 6
Dev Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |