mirror of
https://github.com/egoist/tsup.git
synced 2025-12-08 20:35:58 +00:00
chore(ci): [bot] format code
This commit is contained in:
parent
233eb839d6
commit
aa9070e2ab
@ -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,
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
@ -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',
|
||||
|
||||
|
||||
@ -257,8 +257,8 @@ export type Options = {
|
||||
* @default true
|
||||
*/
|
||||
removeNodeProtocol?: boolean
|
||||
|
||||
swc?: SwcPluginConfig;
|
||||
|
||||
swc?: SwcPluginConfig
|
||||
}
|
||||
|
||||
export interface NormalizedExperimentalDtsConfig {
|
||||
|
||||
@ -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'],
|
||||
},
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user