diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ca58354..c12ac567 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: - uses: pnpm/action-setup@v4.1.0 name: Install pnpm - - uses: actions/setup-node@v4 + - uses: actions/setup-node@v6 with: node-version: ${{ matrix.node-version }} cache: pnpm diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index c9916a2e..5793bc82 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -16,7 +16,7 @@ jobs: - uses: pnpm/action-setup@v4.1.0 name: Install pnpm - - uses: actions/setup-node@v4 + - uses: actions/setup-node@v6 with: node-version: lts/* cache: pnpm diff --git a/.github/workflows/release-continuous.yml b/.github/workflows/release-continuous.yml index 2c8b81a9..18cefd5f 100644 --- a/.github/workflows/release-continuous.yml +++ b/.github/workflows/release-continuous.yml @@ -12,7 +12,7 @@ jobs: - uses: pnpm/action-setup@v4.1.0 name: Install pnpm - - uses: actions/setup-node@v4 + - uses: actions/setup-node@v6 with: node-version: lts/* cache: pnpm diff --git a/docs/README.md b/docs/README.md index e9816cec..e095f33f 100644 --- a/docs/README.md +++ b/docs/README.md @@ -615,6 +615,7 @@ When you use legacy TypeScript decorator by enabling `emitDecoratorMetadata` in decorators. In this case, you can give extra swc configuration in the `tsup.config.ts` file. For example, if you have to define `useDefineForClassFields`, you can do that as follows: + ```ts import { defineConfig } from 'tsup' @@ -626,10 +627,10 @@ export default defineConfig({ swc: { jsc: { transform: { - useDefineForClassFields: true - } - } - } + useDefineForClassFields: true, + }, + }, + }, }) ``` @@ -648,9 +649,9 @@ Note: some SWC options cannot be configured: "keepClassNames": true, "target": "es2022" } - ``` +``` -You can also define a custom `.swcrc` configuration file. Just set `swcrc` to `true` +You can also define a custom `.swcrc` configuration file. Just set `swcrc` to `true` in `tsup.config.ts` to allow SWC plugin to discover automatically your custom swc config file. ```ts @@ -662,8 +663,8 @@ export default defineConfig({ sourcemap: true, clean: true, swc: { - swcrc: true - } + swcrc: true, + }, }) ``` diff --git a/src/esbuild/swc.ts b/src/esbuild/swc.ts index 755009d3..ee12c1dc 100644 --- a/src/esbuild/swc.ts +++ b/src/esbuild/swc.ts @@ -9,7 +9,10 @@ import type { Logger } from '../log' export type SwcPluginConfig = { logger: Logger } & Options -export const swcPlugin = ({ logger, ...swcOptions }: SwcPluginConfig): Plugin => { +export const swcPlugin = ({ + logger, + ...swcOptions +}: SwcPluginConfig): Plugin => { return { name: 'swc', diff --git a/src/options.ts b/src/options.ts index 6bbee23b..7f68bd8c 100644 --- a/src/options.ts +++ b/src/options.ts @@ -257,8 +257,8 @@ export type Options = { * @default true */ removeNodeProtocol?: boolean - - swc?: SwcPluginConfig; + + swc?: SwcPluginConfig } export interface NormalizedExperimentalDtsConfig { diff --git a/vitest.config.mts b/vitest.config.mts index 8f6d3ac6..7e032eda 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -4,6 +4,6 @@ export default defineConfig({ test: { testTimeout: 50000, globalSetup: 'vitest-global.ts', - include: ["test/*.test.ts", "src/**/*.test.ts"] + include: ['test/*.test.ts', 'src/**/*.test.ts'], }, })