Skip to content

Commit 26b7aa4

Browse files
chore(ci): [bot] format code
1 parent 4eb0548 commit 26b7aa4

5 files changed

Lines changed: 23 additions & 18 deletions

File tree

assets/cjs_shims.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
// if we export it as `const importMetaUrl = ... __filename ...`
44
// But using a function will not cause this issue
55

6-
const getImportMetaUrl = () =>
7-
typeof document === "undefined"
8-
? new URL(`file:${__filename}`).href
9-
: (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
10-
? document.currentScript.src
11-
: new URL("main.js", document.baseURI).href;
6+
const getImportMetaUrl = () =>
7+
typeof document === 'undefined'
8+
? new URL(`file:${__filename}`).href
9+
: document.currentScript &&
10+
document.currentScript.tagName.toUpperCase() === 'SCRIPT'
11+
? document.currentScript.src
12+
: new URL('main.js', document.baseURI).href
1213

1314
export const importMetaUrl = /* @__PURE__ */ getImportMetaUrl()

docs/README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,7 @@ When you use legacy TypeScript decorator by enabling `emitDecoratorMetadata` in
615615
decorators. In this case, you can give extra swc configuration in the `tsup.config.ts` file.
616616

617617
For example, if you have to define `useDefineForClassFields`, you can do that as follows:
618+
618619
```ts
619620
import { 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`
654655
in `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

src/esbuild/swc.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ import type { Logger } from '../log'
99

1010
export 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

src/options.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,8 @@ export type Options = {
257257
* @default true
258258
*/
259259
removeNodeProtocol?: boolean
260-
261-
swc?: SwcPluginConfig;
260+
261+
swc?: SwcPluginConfig
262262
}
263263

264264
export interface NormalizedExperimentalDtsConfig {

vitest.config.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
})

0 commit comments

Comments
 (0)