@@ -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 =
@@ -328,17 +328,17 @@ function isDefineComponentCall(
328328 )
329329}
330330
331- const hash =
332- // eslint-disable-next-line n/no-unsupported-features/node-builtins -- crypto.hash is supported in Node 21.7.0+, 20.12.0+
333- crypto . hash ??
334- ( (
335- algorithm : string ,
336- data : crypto . BinaryLike ,
337- outputEncoding : crypto . BinaryToTextEncoding ,
338- ) => crypto . createHash ( algorithm ) . update ( data ) . digest ( outputEncoding ) )
339-
340331function getHash ( text : string ) {
341- return hash ( 'sha256' , text , 'hex' ) . substring ( 0 , 8 )
332+ return crypto . hash ( 'sha256' , text , 'hex' ) . substring ( 0 , 8 )
342333}
343334
344335export 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' }
0 commit comments