File tree 3 files changed +430
-426
lines changed
3 files changed +430
-426
lines changed Original file line number Diff line number Diff line change
1
+ import fs from 'node:fs/promises'
1
2
import { defineBuildConfig } from 'unbuild'
2
3
3
4
export default defineBuildConfig ( {
4
5
entries : [ 'src/index' ] ,
5
6
externals : [ 'vite' ] ,
6
7
clean : true ,
7
- declaration : 'compatible' ,
8
+ declaration : true ,
8
9
rollup : {
9
10
emitCJS : true ,
10
11
inlineDependencies : true ,
11
12
esbuild : {
12
- target : 'node14.21.3 ' ,
13
+ target : 'node18 ' ,
13
14
} ,
14
15
output : {
15
16
generatedCode : {
16
17
reservedNamesAsProps : false ,
17
18
} ,
18
19
} ,
19
20
} ,
21
+ hooks : {
22
+ async 'build:done' ( ctx ) {
23
+ // Remove duplicated `dist/chunks/certificate.{cjs,mjs}` chunks
24
+ // as both are only dynamically imported by the entrypoints. The
25
+ // dynamic import can use the `.mjs` chunk only instead.
26
+ await fs . rm ( 'dist/chunks/certificate.cjs' )
27
+ const indexCjs = await fs . readFile ( 'dist/index.cjs' , 'utf8' )
28
+ const editedIndexCjs = indexCjs . replace (
29
+ 'chunks/certificate.cjs' ,
30
+ 'chunks/certificate.mjs' ,
31
+ )
32
+ if ( indexCjs === editedIndexCjs ) {
33
+ throw new Error (
34
+ 'Failed to find `dist/chunks/certificate.cjs` in `dist/index.cjs`' ,
35
+ )
36
+ }
37
+ await fs . writeFile ( 'dist/index.cjs' , editedIndexCjs )
38
+ } ,
39
+ } ,
20
40
} )
Original file line number Diff line number Diff line change 24
24
"changelog" : " conventional-changelog -p angular -i CHANGELOG.md -s"
25
25
},
26
26
"engines" : {
27
- "node" : " >=14.21.3 "
27
+ "node" : " ^18.0.0 || ^20.0.0 || >=22.0.0 "
28
28
},
29
29
"packageManager" :
" [email protected] " ,
30
30
"repository" : {
36
36
},
37
37
"homepage" : " https://github.com/vitejs/vite-plugin-basic-ssl/#readme" ,
38
38
"peerDependencies" : {
39
- "vite" : " ^3.0.0 || ^4.0.0 || ^5.0.0 || ^ 6.0.0"
39
+ "vite" : " ^6.0.0"
40
40
},
41
41
"devDependencies" : {
42
42
"@types/node" : " ^22.13.5" ,
49
49
"prettier" : " ^3.5.2" ,
50
50
"semver" : " ^7.7.1" ,
51
51
"tsx" : " ^4.19.3" ,
52
+ "typescript" : " ^5.7.3" ,
52
53
"unbuild" : " ^3.3.1" ,
53
54
"vite" : " ^6.2.0" ,
54
55
"vitest" : " ^3.0.7"
You can’t perform that action at this time.
0 commit comments