File tree Expand file tree Collapse file tree 7 files changed +26
-86
lines changed Expand file tree Collapse file tree 7 files changed +26
-86
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,4 @@ export default defineBuildConfig({
44 entries : [ 'src/index' ] ,
55 clean : true ,
66 declaration : true ,
7- rollup : {
8- emitCJS : true ,
9- } ,
107} )
Original file line number Diff line number Diff line change 11{
22 "name" : " @vitejs/plugin-vue-jsx" ,
33 "version" : " 4.2.0" ,
4- "type" : " commonjs " ,
4+ "type" : " module " ,
55 "license" : " MIT" ,
66 "author" : " Evan You" ,
77 "files" : [
88 " dist"
99 ],
10- "main" : " ./dist/index.cjs" ,
11- "module" : " ./dist/index.mjs" ,
12- "types" : " ./dist/index.d.ts" ,
13- "exports" : {
14- "." : {
15- "import" : " ./dist/index.mjs" ,
16- "require" : " ./dist/index.cjs"
17- }
18- },
10+ "exports" : " ./dist/index.mjs" ,
1911 "scripts" : {
2012 "dev" : " unbuild --stub" ,
21- "build" : " unbuild && pnpm run patch-cjs" ,
22- "patch-cjs" : " tsx ../../scripts/patchCJS.ts" ,
13+ "build" : " unbuild" ,
2314 "prepublishOnly" : " npm run build"
2415 },
2516 "engines" : {
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import {
1212} from '@rolldown/pluginutils'
1313import type { Options } from './types'
1414
15- export * from './types'
15+ export type * from './types'
1616
1717const ssrRegisterHelperId = '/__vue-jsx-ssr-register-helper'
1818const ssrRegisterHelperCode =
@@ -333,3 +333,12 @@ function getHash(text: string) {
333333}
334334
335335export default vueJsxPlugin
336+
337+ // Compat for require
338+ function vueJsxPluginCjs ( this : unknown , options : Options ) : Plugin {
339+ return vueJsxPlugin . call ( this , options )
340+ }
341+ Object . assign ( vueJsxPluginCjs , {
342+ default : vueJsxPluginCjs ,
343+ } )
344+ export { vueJsxPluginCjs as 'module.exports' }
Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ export default defineBuildConfig({
66 clean : true ,
77 declaration : 'compatible' ,
88 rollup : {
9- emitCJS : true ,
109 inlineDependencies : true ,
1110 } ,
1211} )
Original file line number Diff line number Diff line change 11{
22 "name" : " @vitejs/plugin-vue" ,
33 "version" : " 6.0.0-beta.1" ,
4- "type" : " commonjs " ,
4+ "type" : " module " ,
55 "license" : " MIT" ,
66 "author" : " Evan You" ,
77 "files" : [
88 " dist"
99 ],
10- "main" : " ./dist/index.cjs" ,
11- "module" : " ./dist/index.mjs" ,
12- "types" : " ./dist/index.d.ts" ,
13- "exports" : {
14- "." : {
15- "import" : " ./dist/index.mjs" ,
16- "require" : " ./dist/index.cjs"
17- }
18- },
10+ "exports" : " ./dist/index.mjs" ,
1911 "scripts" : {
2012 "dev" : " unbuild --stub" ,
21- "build" : " unbuild && pnpm run patch-cjs" ,
22- "patch-cjs" : " tsx ../../scripts/patchCJS.ts" ,
13+ "build" : " unbuild" ,
2314 "prepublishOnly" : " npm run build"
2415 },
2516 "engines" : {
Original file line number Diff line number Diff line change @@ -517,3 +517,13 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin<Api> {
517517function ensureArray < T > ( value : T | T [ ] ) : T [ ] {
518518 return Array . isArray ( value ) ? value : [ value ]
519519}
520+
521+ // Compat for require
522+ function vuePluginCjs ( this : unknown , options : Options ) : Plugin < Api > {
523+ return vuePlugin . call ( this , options )
524+ }
525+ Object . assign ( vuePluginCjs , {
526+ default : vuePluginCjs ,
527+ parseVueRequest,
528+ } )
529+ export { vuePluginCjs as 'module.exports' }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments