Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: egoist/tsup
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v6.7.0
Choose a base ref
...
head repository: egoist/tsup
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v7.0.0
Choose a head ref
  • 15 commits
  • 15 files changed
  • 11 contributors

Commits on Mar 31, 2023

  1. Copy the full SHA
    322cb77 View commit details

Commits on Jun 16, 2023

  1. feat: Update esbuild version to latest for keeping unknown directives…

    … during bundle (#925)
    
    BREAKING CHANGE:
    
    update esbuild to 0.18
    teobler authored Jun 16, 2023
    Copy the full SHA
    e2e70e8 View commit details
  2. feat: require nodejs 16 or above

    BREAKING CHANGE:
    
    require nodejs 16 or above
    egoist committed Jun 16, 2023
    Copy the full SHA
    45832d9 View commit details
  3. chore: recreate lockfile

    egoist committed Jun 16, 2023
    Copy the full SHA
    8dc8491 View commit details
  4. Copy the full SHA
    4027d3a View commit details
  5. chore: update github actions

    egoist committed Jun 16, 2023
    Copy the full SHA
    33d8ab8 View commit details
  6. refactor(options)!: type format as Format (#877)

    This types Options.format as `Format[] | Format` instead of `Format[] | string`
    spifory authored Jun 16, 2023
    Copy the full SHA
    b10a1ad View commit details
  7. Copy the full SHA
    cfa6bba View commit details
  8. chore: update postcss-load-config (#880)

    * chore: update postcss-load-config
    
    * chore: install pnpm@7 in CI
    
    * use pnpm v8
    
    ---------
    
    Co-authored-by: EGOIST <hi@egoist.dev>
    await-ovo and egoist authored Jun 16, 2023
    Copy the full SHA
    68297f7 View commit details
  9. Copy the full SHA
    2f41663 View commit details
  10. fix: preserve top-level when running terser for IIFE (#900)

    Co-authored-by: EGOIST <hi@egoist.dev>
    sapphi-red and egoist authored Jun 16, 2023
    Copy the full SHA
    2c0435a View commit details
  11. Copy the full SHA
    23e25cd View commit details
  12. Copy the full SHA
    a036242 View commit details
  13. Copy the full SHA
    e3f02be View commit details
  14. feat: support svelte-preprocess (#906)

    * feat: support svelte-preprocess
    
    * chore: update lockfile
    
    ---------
    
    Co-authored-by: EGOIST <hi@egoist.dev>
    tmkx and egoist authored Jun 16, 2023
    1
    Copy the full SHA
    3606e45 View commit details
Showing with 1,514 additions and 604 deletions.
  1. +9 −9 .github/workflows/ci.yml
  2. +2 −1 .gitignore
  3. +6 −2 docs/README.md
  4. +7 −4 package.json
  5. +846 −373 pnpm-lock.yaml
  6. +1 −1 schema.json
  7. +3 −3 src/esbuild/external.ts
  8. +36 −18 src/esbuild/svelte.ts
  9. +5 −6 src/index.ts
  10. +2 −2 src/options.ts
  11. +1 −1 src/plugins/es5.ts
  12. +6 −4 src/plugins/terser.ts
  13. +0 −2 test/__snapshots__/index.test.ts.snap
  14. +79 −11 test/index.test.ts
  15. +511 −167 test/pnpm-lock.yaml
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -13,21 +13,21 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node-version: [14.x, 16.x]
node-version: [16.x, 18.x]

runs-on: ${{ matrix.os }}

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-node@v2
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Cache ~/.pnpm-store
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: cache-pnpm-store
with:
@@ -38,7 +38,7 @@ jobs:
${{ runner.os }}-${{ matrix.node-version }}-test-
${{ runner.os }}-
- name: Install pnpm
run: npm i -g pnpm
run: corepack enable

- name: Install deps
run: pnpm i
@@ -52,12 +52,12 @@ jobs:
needs: ['test']
if: "!contains(github.event.head_commit.message, 'skip-release') && !contains(github.event.head_commit.message, 'skip-ci') && github.event_name != 'pull_request'"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Cache ~/.pnpm-store
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: cache-pnpm-store
with:
@@ -67,7 +67,7 @@ jobs:
${{ runner.os }}-${{ matrix.node-version }}-release-${{ env.cache-name }}-
${{ runner.os }}-${{ matrix.node-version }}-release-
${{ runner.os }}-
- run: npm i -g pnpm
- run: corepack enable
- run: pnpm i
- run: pnpx semantic-release --branches main
env:
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -2,4 +2,5 @@ node_modules
*.log
dist
.cache
playground
playground
.idea
8 changes: 6 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -52,13 +52,13 @@ This will output `dist/index.js` and `dist/cli.js`.

### Excluding packages

By default tsup bundles all `import`-ed modules but `dependencies` and `peerDependencies` in your `packages.json` are always excluded, you can also use `--external <module|pkgJson>` flag to mark other packages or other special `package.json`'s `dependencies` and `peerDependencies` as external.
By default tsup bundles all `import`-ed modules but `dependencies` and `peerDependencies` in your `package.json` are always excluded, you can also use `--external <module|pkgJson>` flag to mark other packages or other special `package.json`'s `dependencies` and `peerDependencies` as external.

### Excluding all packages

If you are using **tsup** to build for **Node.js** applications/APIs, usually bundling dependencies is not needed, and it can even break things, for instance, while outputting to [ESM](https://nodejs.org/api/esm.html).

tsup automatically excludes packages specified in the `dependencies` and `peerDependencies` fields in the `packages.json`, but if it somehow doesn't exclude some packages, this library also has a special executable `tsup-node` that automatically skips bundling any Node.js package.
tsup automatically excludes packages specified in the `dependencies` and `peerDependencies` fields in the `package.json`, but if it somehow doesn't exclude some packages, this library also has a special executable `tsup-node` that automatically skips bundling any Node.js package.

```bash
tsup-node src/index.ts
@@ -162,7 +162,11 @@ Beside using positional arguments `tsup [...files]` to specify multiple entrypoi
```bash
# Outputs `dist/a.js` and `dist/b.js`.
tsup --entry src/a.ts --entry src/b.ts
```

The associated output file names can be defined as follows:

```bash
# Outputs `dist/foo.js` and `dist/bar.js`.
tsup --entry.foo src/a.ts --entry.bar src/b.ts
```
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -32,11 +32,11 @@
"cac": "^6.7.12",
"chokidar": "^3.5.1",
"debug": "^4.3.1",
"esbuild": "^0.17.6",
"esbuild": "^0.18.2",
"execa": "^5.0.0",
"globby": "^11.0.3",
"joycon": "^3.0.1",
"postcss-load-config": "^3.0.1",
"postcss-load-config": "^4.0.1",
"resolve-from": "^5.0.0",
"rollup": "^3.2.5",
"source-map": "0.8.0-beta.0",
@@ -61,8 +61,10 @@
"resolve": "1.20.0",
"rollup-plugin-dts": "5.3.0",
"rollup-plugin-hashbang": "2.2.2",
"sass": "1.62.1",
"strip-json-comments": "4.0.0",
"svelte": "3.46.4",
"svelte-preprocess": "5.0.3",
"terser": "^5.16.0",
"ts-essentials": "9.1.2",
"tsconfig-paths": "3.12.0",
@@ -88,6 +90,7 @@
}
},
"engines": {
"node": ">=14.18"
}
"node": ">=16.14"
},
"packageManager": "pnpm@8.6.0"
}
Loading