这是indexloc提供的服务,不要输入任何密码
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
# 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@v4
- uses: actions/checkout@v5

- uses: pnpm/action-setup@v4.1.0
name: Install pnpm
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- uses: pnpm/action-setup@v4.1.0
name: Install pnpm
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-continuous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5

- uses: pnpm/action-setup@v4.1.0
name: Install pnpm
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
fetch-depth: 0

Expand Down
17 changes: 9 additions & 8 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand All @@ -626,10 +627,10 @@ export default defineConfig({
swc: {
jsc: {
transform: {
useDefineForClassFields: true
}
}
}
useDefineForClassFields: true,
},
},
},
})
```

Expand All @@ -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
Expand All @@ -662,8 +663,8 @@ export default defineConfig({
sourcemap: true,
clean: true,
swc: {
swcrc: true
}
swcrc: true,
},
})
```

Expand Down
5 changes: 4 additions & 1 deletion src/esbuild/swc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',

Expand Down
4 changes: 2 additions & 2 deletions src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ export type Options = {
* @default true
*/
removeNodeProtocol?: boolean
swc?: SwcPluginConfig;

swc?: SwcPluginConfig
}

export interface NormalizedExperimentalDtsConfig {
Expand Down
2 changes: 1 addition & 1 deletion vitest.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
},
})