1.2.1 • Published 10 months ago

@culur/config-tsup v1.2.1

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

@culur/config-tsup

NPM Version NPM Download NPM License

CodeFactor Codecov Build and release

Sharing tsup configurations.

✨ Features

The library includes several tsup configurations for reuse.

1. Shared configuration

const sharedConfig = {
  sourcemap: true,
  clean: true,
  dts: true,
  entry: [
    'src/**/*.ts', //
    '!src/**/*.test.ts',
    '!src/**/*.spec.ts',
  ],
  treeshake: 'recommended',
};

2. There are 3 complete configurations

NameFormatSplitting
esmesmtrue
cjscjs
esm_cjsesm, cjstrue

💿 Installation

Add @culur/config-tsup dependency to your project.

# Using npm
npm install @culur/config-tsup --save-dev

# Using pnpm
pnpm install @culur/config-tsup --dev

# Using yarn
yarn add @culur/config-tsup --dev

Other packages:

  • You also need to install tsup and typescript packages in devDependencies.

📖 Usage

1. Use the config directly

In tsup.config.ts, use:

import { cjs, esm, esm_cjs } from '@culur/config-tsup';

// format 'esm'
export default esm;

// format 'cjs'
export default cjs;

// format 'esm_cjs'
export default esm_cjs;

2. Overwrite some properties from the shared configuration

In tsup.config.ts, use defineConfig:

import { defineConfig, esm } from '@culur/config-tsup';

export default defineConfig({
  ...esm,
  plugins: [
    //...
  ],
});

📜 Scripts

Some commonly used scripts in package.json.

{
  "exports": {
    ".": {
      "import": {
        "types": "./dist/index.d.ts",
        "default": "./dist/index.js"
      },
      "require": {
        "types": "./dist/index.d.cts",
        "default": "./dist/index.cjs"
      }
    }
  },
  "files": ["CHANGELOG.md", "LICENSE", "README.md", "dist", "src"],
  "scripts": {
    "build": "tsup"
  }
}

🗃️ Changelog

See CHANGELOG for more information on what has changed recently.

🔒 License

See LICENSE for license rights and limitations (MIT).

1.2.1

10 months ago

1.2.0

10 months ago

1.1.4

10 months ago

1.1.3

11 months ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

0.0.0

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago