JSPM

@strapi/pack-up

4.15.0-alpha.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 32266
  • Score
    100M100P100Q160223F
  • License SEE LICENSE IN LICENSE

Simple tools for creating interoperable CJS & ESM packages.

Package Exports

  • @strapi/pack-up
  • @strapi/pack-up/package.json

Readme

pack-up

Your daily lunchbox of bundling tools


Chat on Discord


pack-up is a set of simple tools for creating interoperable CJS & ESM packages.

Setting up a new interoperable project is as easy as doing:

npx @strapi/pack-up@latest init my-package

cd my-package

npm run build

Just a small bit about us:

  • Vite: We support vite as a JS bundler, no need to install it though as it's preprepared with helpful defaults ready to tackle all projects.
  • Concise: It's all based off your package.json so you know the interoperable aspect is correctly set up and there's no requirement for another config!
  • Flexible: Need more customisation or to bundle a package not declared in your exports? Use the config file to dictate separate bundles & options.

Getting Started

If you're setting up a brand new package we recommend you use the init command to get started:

npx @strapi/pack-up@latest init my-package

But if you're adding this to an existing project then just install like every other dependency:

npm install @strapi/pack-up@latest --save-dev

And to help you ensure your package is set up correctly run the check command:

npm run pack-up check

Run pack-up -h for more information on CLI usage.

Configuration

@strapi/pack-up by default reads its configuration from your package.json. But sometimes you need more flexibility, to do this you can create a package.config.ts file in the root of your package.

// package.config.ts

import { defineConfig } from '@strapi/pack-up';

export default defineConfig({
  minify: true,
  sourcemap: false,
  // the path to the tsconfig file for distributed builds
  tsconfig: 'tsconfig.dist.json',
});