1.0.2 • Published 4 months ago

@pkg-tools/build v1.0.2

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

@pkg-tools/build

A build tool with typed configuration.

@pkg-tools/build::version @pkg-tools/build::downloads

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

Install

# w/ pnpm
pnpm add -D @pkg-tools/build @pkg-tools/config

# w/ yarn
yarn add -D @pkg-tools/build @pkg-tools/config

# w/ npm
npm install -D @pkg-tools/build @pkg-tools/config

Usage

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

"scripts": {
  "build": "build"
  "dev": "build -w"
  "stub": "build -s"
}

Configure

Define a pkg.config.ts in the root of your package and add the following.

import { defineConfig } from "@pkg-tools/config";

export default defineConfig({
  build: {
    entries: ["src/index"],
    sourcemap: true,
    extensions: "compatible",
    rollup: {
      inlineDependencies: true,
      emitCJS: true,
      esbuild: {
        target: ["node16"],
        minify: true,
      },
    },
    declaration: "compatible",
  },
});

License

MIT

1.0.2

4 months ago

1.0.1

4 months ago

1.0.0

4 months ago

0.2.0

5 months ago

0.1.0

5 months ago

0.1.1

5 months ago

0.0.6

6 months ago

0.0.5

6 months ago

0.0.4

6 months ago

0.0.3

6 months ago

0.0.2

6 months ago

0.0.1

6 months ago