@@ -12,7 +12,7 @@ import {
12
12
} from '@rolldown/pluginutils'
13
13
import type { Options } from './types'
14
14
15
- export * from './types'
15
+ export type * from './types'
16
16
17
17
const ssrRegisterHelperId = '/__vue-jsx-ssr-register-helper'
18
18
const ssrRegisterHelperCode =
@@ -328,17 +328,17 @@ function isDefineComponentCall(
328
328
)
329
329
}
330
330
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
-
340
331
function getHash ( text : string ) {
341
- return hash ( 'sha256' , text , 'hex' ) . substring ( 0 , 8 )
332
+ return crypto . hash ( 'sha256' , text , 'hex' ) . substring ( 0 , 8 )
342
333
}
343
334
344
335
export 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