File tree Expand file tree Collapse file tree 7 files changed +127
-130
lines changed
packages/plugin-react-swc Expand file tree Collapse file tree 7 files changed +127
-130
lines changed Original file line number Diff line number Diff line change 15
15
"type" : " module" ,
16
16
"private" : true ,
17
17
"scripts" : {
18
- "dev" : " tsx scripts/bundle.ts --dev " ,
19
- "build" : " tsx scripts/bundle.ts " ,
18
+ "dev" : " tsdown --watch " ,
19
+ "build" : " tsdown " ,
20
20
"test" : " playwright test"
21
21
},
22
22
"repository" : {
40
40
"@types/fs-extra" : " ^11.0.4" ,
41
41
"@types/node" : " ^22.16.0" ,
42
42
"@vitejs/react-common" : " workspace:*" ,
43
- "esbuild" : " ^0.25.5" ,
44
43
"fs-extra" : " ^11.3.0" ,
45
- "picocolors" : " ^1.1.1" ,
46
44
"prettier" : " ^3.0.3" ,
45
+ "tsdown" : " ^0.12.9" ,
47
46
"typescript" : " ^5.8.3"
48
47
}
49
48
}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
{
2
- "include" : [
3
- " src" ,
4
- " scripts" ,
5
- " playwright.config.ts" ,
6
- " playground/utils.ts" ,
7
- " playground/*/__tests__"
8
- ],
9
- "compilerOptions" : {
10
- /* Target node 22 */
11
- "module" : " ESNext" ,
12
- "lib" : [" ES2023" , " DOM" ],
13
- "target" : " ES2023" ,
14
- "skipLibCheck" : true ,
15
-
16
- /* Bundler mode */
17
- "moduleResolution" : " bundler" ,
18
- "allowImportingTsExtensions" : true ,
19
- "verbatimModuleSyntax" : true ,
20
- "noEmit" : true ,
21
-
22
- /* Linting */
23
- "strict" : true ,
24
- "noUnusedLocals" : true ,
25
- "noUnusedParameters" : true ,
26
- "noFallthroughCasesInSwitch" : true ,
27
- "useUnknownInCatchVariables" : true ,
28
- "noUncheckedSideEffectImports" : true ,
29
- "noPropertyAccessFromIndexSignature" : true
30
- }
2
+ "include" : [],
3
+ "references" : [
4
+ { "path" : " ./tsconfig.src.json" },
5
+ { "path" : " ./tsconfig.test.json" }
6
+ ]
31
7
}
Original file line number Diff line number Diff line change
1
+ {
2
+ "include" : [" src" ],
3
+ "compilerOptions" : {
4
+ /* Target node 22 */
5
+ "module" : " ESNext" ,
6
+ "lib" : [" ES2023" , " DOM" ],
7
+ "target" : " ES2023" ,
8
+ "skipLibCheck" : true ,
9
+
10
+ /* Bundler mode */
11
+ "moduleResolution" : " bundler" ,
12
+ "allowImportingTsExtensions" : true ,
13
+ "verbatimModuleSyntax" : true ,
14
+ "noEmit" : true ,
15
+ "declaration" : true ,
16
+ "isolatedDeclarations" : true ,
17
+
18
+ /* Linting */
19
+ "strict" : true ,
20
+ "noUnusedLocals" : true ,
21
+ "noUnusedParameters" : true ,
22
+ "noFallthroughCasesInSwitch" : true ,
23
+ "useUnknownInCatchVariables" : true ,
24
+ "noUncheckedSideEffectImports" : true ,
25
+ "noPropertyAccessFromIndexSignature" : true
26
+ }
27
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "include" : [" playwright.config.ts" , " playground" ],
3
+ "compilerOptions" : {
4
+ /* Target node 22 */
5
+ "module" : " ESNext" ,
6
+ "lib" : [" ES2023" , " DOM" ],
7
+ "target" : " ES2023" ,
8
+ "skipLibCheck" : true ,
9
+
10
+ /* Bundler mode */
11
+ "moduleResolution" : " bundler" ,
12
+ "allowImportingTsExtensions" : true ,
13
+ "verbatimModuleSyntax" : true ,
14
+ "noEmit" : true ,
15
+
16
+ /* Linting */
17
+ "strict" : true ,
18
+ "noUnusedLocals" : true ,
19
+ "noUnusedParameters" : true ,
20
+ "noFallthroughCasesInSwitch" : true ,
21
+ "useUnknownInCatchVariables" : true ,
22
+ "noUncheckedSideEffectImports" : true ,
23
+ "noPropertyAccessFromIndexSignature" : true
24
+ }
25
+ }
Original file line number Diff line number Diff line change
1
+ import { writeFileSync } from 'node:fs'
2
+ import { defineConfig } from 'tsdown'
3
+ import packageJSON from './package.json' with { type : 'json' }
4
+
5
+ export default defineConfig ( {
6
+ entry : 'src/index.ts' ,
7
+ format : [ 'esm' , 'cjs' ] ,
8
+ dts : true ,
9
+ tsconfig : './tsconfig.src.json' , // https://github.com/sxzz/rolldown-plugin-dts/issues/55
10
+ copy : [
11
+ {
12
+ from : 'node_modules/@vitejs/react-common/refresh-runtime.js' ,
13
+ to : 'dist/refresh-runtime.js' ,
14
+ } ,
15
+ {
16
+ from : 'LICENSE' ,
17
+ to : 'dist/LICENSE' ,
18
+ } ,
19
+ {
20
+ from : 'README.md' ,
21
+ to : 'dist/README.md' ,
22
+ } ,
23
+ ] ,
24
+ outputOptions ( outputOpts , format ) {
25
+ if ( format === 'cjs' ) {
26
+ outputOpts . footer = ( chunk ) => {
27
+ // don't append to dts files
28
+ if ( chunk . fileName . endsWith ( '.cjs' ) ) {
29
+ return 'module.exports.default = module.exports'
30
+ }
31
+ return ''
32
+ }
33
+ }
34
+ return outputOpts
35
+ } ,
36
+ onSuccess ( ) {
37
+ writeFileSync (
38
+ 'dist/package.json' ,
39
+ JSON . stringify (
40
+ {
41
+ ...Object . fromEntries (
42
+ Object . entries ( packageJSON ) . filter (
43
+ ( [ key , _val ] ) =>
44
+ key !== 'devDependencies' &&
45
+ key !== 'scripts' &&
46
+ key !== 'private' ,
47
+ ) ,
48
+ ) ,
49
+ main : 'index.cjs' ,
50
+ types : 'index.d.ts' ,
51
+ module : 'index.js' ,
52
+ exports : {
53
+ '.' : {
54
+ require : './index.cjs' ,
55
+ import : './index.js' ,
56
+ } ,
57
+ } ,
58
+ } ,
59
+ null ,
60
+ 2 ,
61
+ ) ,
62
+ )
63
+ } ,
64
+ } )
You can’t perform that action at this time.
0 commit comments