1.1.1 • Published 8 months ago

@dopt/pkg-build v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

@dopt/pkg-build

A CLI for building packages.

This CLI is a thin abstraction on top of unbuild. It centralizes our build configuration, which helps us consistently build opensource packages that support both module systems (CJS and ESM).

Install

# w/ pnpm
pnpm add -D @dopt/pkg-build

# w/ yarn
yarn add -D @dopt/pkg-build

# w/ npm
npm install -D @dopt/pkg-build

Usage

Create a build.config.ts in your package root that imports @dopt/pkg-build.

This package exports external and internal build configurations. External are for package we externalize i.e. opensource and publish.

We provide four different external package build configurations.

  1. node
  2. isomorphic
  3. browser
  4. react

If we were building a node package, our build.config.ts might look like the following.

import { external } from '@dopt/pkg-build';

export default external.node({
  // ... override any default build configuration
})

Now, in your package.json, you can use the exported cli pkg-build in your build script e.g.

"scripts": {
  "build": "pkg-build"
}

Using your package manager, you can now run the build script to build your package.

1.1.1

8 months ago

1.1.0

8 months ago

1.0.0

8 months ago

0.0.0

9 months ago