Skip to content

zhengyuzi/rollup-build

Repository files navigation

@zhengyuzi/rollup-build

An ES module bundler based on Rollup.

Install

npm install --save-dev @zhengyuzi/rollup-build

Usage

Add the build command to package.json

{
  "scripts": {
    "build": "robuild"
  }
}

Create build.config.ts

import { defineConfig } from '@zhengyuzi/rollup-build'

export default defineConfig({
  entries: [
    'src/index',
  ],
})

Configuration

entries

Build entries.

outDir

Output directory.

clean

Clean dist dirs.

declaration

Generates .d.ts declaration file.

emitCJS

Minify build.

externals

View rollup-plugin-node-externals

plugins

Add rollup plugin.

Command

dir

The directory to build/stub.

{
  "scripts": {
    "build": "robuild output"
  }
}

stub

Stub dist link your project during the development.

{
  "scripts": {
    "build": "robuild --stub"
  }
}

Reference