diff --git a/README.md b/README.md index ca80c2c1..416782c9 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,11 @@
-**bunchee** is a zero configuration bundler makes bundling JS/TS library effortless. It's built on top of Rollup and SWC ⚡️, allowing you to focus on writing code and generating multiple bundles (CommonJS or ESModule) at the same time. -It uses the standard exports configuration in `package.json` as the only source of truth, and uses entry file conventions to match your exports and build them into bundles. +--- + +**bunchee** is a zero-configuration bundler designed to streamline package building by adhering to the `exports` field in your **package.json**. Powered by Rollup and SWC ⚡️, it generates output based on your config, supporting both CommonJS and ESModules. + +By using the standard `exports` configuration as the single source of truth, **bunchee** automatically aligns entry file conventions with your exports, ensuring seamless and efficient builds. ## Quick Start @@ -71,6 +74,31 @@ The output format will based on the exports condition and also the file extensio > [!NOTE] > All the `dependencies` and `peerDependencies` will be marked as external automatically and not included in the bundle. If you want to include them in the bundle, you can use the `--no-external` option. +### Output Formats + +**bunchee** detects the format of each entry-point based on export condition type or the file extension. It supports the following output formats: + +| `package.json` Field | Output format | +| -------------------- | -------------------------------- | +| `main` | Default | +| `types` | TypeScript declaration | +| `exports` | Default | +| `exports.require` | CommonJS | +| `exports.import` | Default | +| `exports.types` | TypeScript declaration of export | +| `bin` | Default | +| `bin.