Skip to content

Stub dist link your project during the development

License

Notifications You must be signed in to change notification settings

zhengyuzi/stubb

Repository files navigation

stubb

npm NPM

Stub dist link your project during the development.

Install

npm install --save-dev stubb

Usage

In the package.json of the package in need:

{
  "scripts": {
    "stub": "stubb"
  }
}

Default project structure:

|-- package
    |-- dist/
        |-- index.js
        |-- index.cjs
        |-- index.mjs
        |-- index.d.ts
    |-- src/
        |-- index.ts
    |-- package.json

Options

entries

Set one or more entry paths. Default: src/index

{
  "scripts": {
    "stub": "stubb test/index,test/plugins"
  }
}

outputDir

The folder name/path of the output file. Default: dist

{
  "scripts": {
    "stub": "stubb --outputDir=ouput"
  }
}

fill

Auto fill in exports/main/module/types in package.json. Default: false

{
  "scripts": {
    "stub": "stubb --fill"
  }
}

esm

Open esm. Default: true

cjs

Open cjs. Default: true

ts

Open types. Default: true