File tree Expand file tree Collapse file tree 3 files changed +19
-25
lines changed Expand file tree Collapse file tree 3 files changed +19
-25
lines changed Original file line number Diff line number Diff line change 1818 },
1919 "scripts" : {
2020 "dev" : " unbuild --stub" ,
21- "build" : " unbuild && pnpm run patch-cjs" ,
22- "patch-cjs" : " esno ../../scripts/patchCJS.ts" ,
21+ "build" : " unbuild && esno scripts/patchCJS.ts" ,
2322 "prepublishOnly" : " npm run build"
2423 },
2524 "engines" : {
2625 "node" : " >=14.6.0"
2726 },
2827 "repository" : {
2928 "type" : " git" ,
30- "url" : " git+https://github.com/vitejs/vite.git" ,
29+ "url" : " git+https://github.com/vitejs/vite-plugin-vue2 .git" ,
3130 "directory" : " packages/plugin-vue"
3231 },
3332 "bugs" : {
34- "url" : " https://github.com/vitejs/vite/issues"
33+ "url" : " https://github.com/vitejs/vite-plugin-vue2 /issues"
3534 },
36- "homepage" : " https://github.com/vitejs/vite/tree/main/packages/ plugin-vue #readme" ,
35+ "homepage" : " https://github.com/vitejs/vite- plugin-vue2/ #readme" ,
3736 "peerDependencies" : {
3837 "vite" : " >=2.5.10" ,
39- "vue" : " ^2.7.0-alpha "
38+ "vue" : " ^2.7.0-0 "
4039 },
4140 "devDependencies" : {
42- "@jridgewell/gen-mapping" : " ^0.3.1" ,
43- "@jridgewell/trace-mapping" : " ^0.3.13" ,
4441 "@rollup/pluginutils" : " ^4.2.1" ,
4542 "debug" : " ^4.3.4" ,
4643 "esno" : " ^0.16.3" ,
4744 "hash-sum" : " ^2.0.0" ,
45+ "picocolors" : " ^1.0.0" ,
4846 "rollup" : " ^2.75.6" ,
4947 "slash" : " ^4.0.0" ,
5048 "source-map" : " ^0.6.1" ,
Original file line number Diff line number Diff line change @@ -41,17 +41,15 @@ if (matchMixed) {
4141 writeFileSync ( indexPath , lines . join ( '\n' ) )
4242
4343 console . log ( colors . bold ( `${ indexPath } CJS patched` ) )
44- process . exit ( )
45- }
46-
47- const matchDefault = code . match ( / \n m o d u l e .e x p o r t s = ( \w + ) ; / )
48-
49- if ( matchDefault ) {
50- code += `module.exports["default"] = ${ matchDefault [ 1 ] } ;\n`
51- writeFileSync ( indexPath , code )
52- console . log ( colors . bold ( `${ indexPath } CJS patched` ) )
53- process . exit ( )
44+ } else {
45+ const matchDefault = code . match ( / \n m o d u l e .e x p o r t s = ( \w + ) ; / )
46+
47+ if ( matchDefault ) {
48+ code += `module.exports["default"] = ${ matchDefault [ 1 ] } ;\n`
49+ writeFileSync ( indexPath , code )
50+ console . log ( colors . bold ( `${ indexPath } CJS patched` ) )
51+ } else {
52+ console . error ( colors . red ( `${ indexPath } CJS patch failed` ) )
53+ process . exit ( 1 )
54+ }
5455}
55-
56- console . error ( colors . red ( `${ indexPath } CJS patch failed` ) )
57- process . exit ( 1 )
You can’t perform that action at this time.
0 commit comments