fix: ensure the same vue dep in all cases

pull/198/head
Evan You 4 years ago
parent 055e3fd043
commit d6b8568c52

@ -37,28 +37,18 @@ export function resolveAliases(
{
find: /^vitepress$/,
replacement: path.join(__dirname, '../client/index')
}
]
let isLinked = false
try {
require.resolve('vitepress', { paths: [root] })
} catch (e) {
isLinked = true
}
if (isLinked) {
// aliases for local linked development
aliases.push(
},
// alias for local linked development
{ find: /^vitepress\//, replacement: PKG_ROOT + '/' },
// make sure it always use the same vue dependency that comes with
// vitepress itself
{
find: /^vue$/,
replacement: require.resolve(
'@vue/runtime-dom/dist/runtime-dom.esm-bundler.js'
)
}
)
}
]
return aliases
}

Loading…
Cancel
Save