File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -615,6 +615,7 @@ When you use legacy TypeScript decorator by enabling `emitDecoratorMetadata` in
615615decorators. In this case, you can give extra swc configuration in the ` tsup.config.ts ` file.
616616
617617For example, if you have to define ` useDefineForClassFields ` , you can do that as follows:
618+
618619``` ts
619620import { defineConfig } from ' tsup'
620621
@@ -626,10 +627,10 @@ export default defineConfig({
626627 swc: {
627628 jsc: {
628629 transform: {
629- useDefineForClassFields: true
630- }
631- }
632- }
630+ useDefineForClassFields: true ,
631+ },
632+ },
633+ },
633634})
634635```
635636
@@ -648,9 +649,9 @@ Note: some SWC options cannot be configured:
648649 "keepClassNames" : true ,
649650 "target" : " es2022"
650651}
651- ```
652+ ```
652653
653- You can also define a custom ` .swcrc ` configuration file. Just set ` swcrc ` to ` true `
654+ You can also define a custom ` .swcrc ` configuration file. Just set ` swcrc ` to ` true `
654655in ` tsup.config.ts ` to allow SWC plugin to discover automatically your custom swc config file.
655656
656657``` ts
@@ -662,8 +663,8 @@ export default defineConfig({
662663 sourcemap: true ,
663664 clean: true ,
664665 swc: {
665- swcrc: true
666- }
666+ swcrc: true ,
667+ },
667668})
668669```
669670
Original file line number Diff line number Diff line change @@ -9,7 +9,10 @@ import type { Logger } from '../log'
99
1010export type SwcPluginConfig = { logger : Logger } & Options
1111
12- export const swcPlugin = ( { logger, ...swcOptions } : SwcPluginConfig ) : Plugin => {
12+ export const swcPlugin = ( {
13+ logger,
14+ ...swcOptions
15+ } : SwcPluginConfig ) : Plugin => {
1316 return {
1417 name : 'swc' ,
1518
Original file line number Diff line number Diff line change @@ -291,8 +291,8 @@ export type Options = {
291291 * @default true
292292 */
293293 removeNodeProtocol ?: boolean
294-
295- swc ?: SwcPluginConfig ;
294+
295+ swc ?: SwcPluginConfig
296296}
297297
298298export interface NormalizedExperimentalDtsConfig extends ExperimentalDtsConfig {
Original file line number Diff line number Diff line change @@ -4,6 +4,6 @@ export default defineConfig({
44 test : {
55 testTimeout : 50000 ,
66 globalSetup : 'vitest-global.ts' ,
7- include : [ " test/*.test.ts" , " src/**/*.test.ts" ]
7+ include : [ ' test/*.test.ts' , ' src/**/*.test.ts' ] ,
88 } ,
99} )
You can’t perform that action at this time.
0 commit comments