Build JS package with ease, package.json as configuration

Installation

npm install --save-dev bunchee typescript

Configuration

Create entry files of your library and package.json.

$ cd ./coffee
$ mkdir src && touch ./src/index.ts

Add the exports in package.json.

{
  "name": "coffee",
  "type": "module",
  "main": "./dist/index.js",
  "scripts": {
    "build": "bunchee"
  }
}

Build

$ npm run build

Output

$ Exports  File             Size
$ .        dist/index.js    5.6 kB