File tree Expand file tree Collapse file tree 3 files changed +430
-426
lines changed Expand file tree Collapse file tree 3 files changed +430
-426
lines changed Original file line number Diff line number Diff line change 1+ import fs from 'node:fs/promises'
12import { defineBuildConfig } from 'unbuild'
23
34export default defineBuildConfig ( {
45 entries : [ 'src/index' ] ,
56 externals : [ 'vite' ] ,
67 clean : true ,
7- declaration : 'compatible' ,
8+ declaration : true ,
89 rollup : {
910 emitCJS : true ,
1011 inlineDependencies : true ,
1112 esbuild : {
12- target : 'node14.21.3 ' ,
13+ target : 'node18 ' ,
1314 } ,
1415 output : {
1516 generatedCode : {
1617 reservedNamesAsProps : false ,
1718 } ,
1819 } ,
1920 } ,
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+ } ,
2040} )
Original file line number Diff line number Diff line change 2424 "changelog" : " conventional-changelog -p angular -i CHANGELOG.md -s"
2525 },
2626 "engines" : {
27- "node" : " >=14.21.3 "
27+ "node" : " ^18.0.0 || ^20.0.0 || >=22.0.0 "
2828 },
2929 "packageManager" : " pnpm@10.4.1" ,
3030 "repository" : {
3636 },
3737 "homepage" : " https://github.com/vitejs/vite-plugin-basic-ssl/#readme" ,
3838 "peerDependencies" : {
39- "vite" : " ^3.0.0 || ^4.0.0 || ^5.0.0 || ^ 6.0.0"
39+ "vite" : " ^6.0.0"
4040 },
4141 "devDependencies" : {
4242 "@types/node" : " ^22.13.5" ,
4949 "prettier" : " ^3.5.2" ,
5050 "semver" : " ^7.7.1" ,
5151 "tsx" : " ^4.19.3" ,
52+ "typescript" : " ^5.7.3" ,
5253 "unbuild" : " ^3.3.1" ,
5354 "vite" : " ^6.2.0" ,
5455 "vitest" : " ^3.0.7"
You can’t perform that action at this time.
0 commit comments