Skip to content

Commit

Permalink
fix: require in CJS, close #483
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Aug 8, 2022
1 parent 52f120f commit 772616b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function resolveOptions(options: Options, root: string): ResolvedOptions
return resolved
}

const _require = createRequire(import.meta.url)
const _require = typeof require === 'undefined' ? createRequire(import.meta.url) : require
function getVueVersion() {
try {
const vue = _require('vue')
Expand Down

0 comments on commit 772616b

Please sign in to comment.