feat(alias): Use esm-bundler as default

pull/4630/head
Lukas Leisten 6 months ago
parent 119da5582f
commit f6414d319a

@ -44,22 +44,24 @@ export function resolveAliases(
} }
] ]
let vuePath = 'vue/dist/vue.esm-bundler.js'
if (!ssr) { if (!ssr) {
// Prioritize vue installed in project root and fallback to // Prioritize vue installed in project root and fallback to
// vue that comes with vitepress itself. // vue that comes with vitepress itself.
// Only do this when not running SSR build, since `vue` needs to be // Only do this when not running SSR build, since `vue` needs to be
// externalized during SSR // externalized during SSR
let vuePath
try { try {
vuePath = require.resolve(vueRuntimePath, { paths: [root] }) vuePath = require.resolve(vueRuntimePath, { paths: [root] })
} catch (e) { } catch (e) {
vuePath = require.resolve(vueRuntimePath) vuePath = require.resolve(vueRuntimePath)
} }
aliases.push({
find: /^vue$/,
replacement: vuePath
})
} }
aliases.push({
find: /^vue$/,
replacement: vuePath
})
return aliases return aliases
} }

Loading…
Cancel
Save