提交 2dd144b0 编写于 作者: fxy060608's avatar fxy060608

fix(h5): ssr

上级 a2bfe1fb
......@@ -29,6 +29,7 @@ export function initModuleAlias() {
if (process.env.VITEST) {
moduleAlias.addAliases({
vue: '@dcloudio/uni-h5-vue',
'vue/package.json': '@dcloudio/uni-h5-vue/package.json',
})
}
if (isInHBuilderX()) {
......
......@@ -81,10 +81,10 @@ export function generateSsrEntryServerCode() {
export function rewriteSsrVue() {
// 解决 @vue/server-renderer 中引入 vue 的映射
require('module-alias').addAlias(
'vue',
resolveBuiltIn('@dcloudio/uni-h5-vue/dist/vue.runtime.cjs.js')
)
require('module-alias').addAliases({
vue: resolveBuiltIn('@dcloudio/uni-h5-vue/dist/vue.runtime.cjs.js'),
'vue/package.json': resolveBuiltIn('@dcloudio/uni-h5-vue/package.json'),
})
// TODO vite 2.7.0 版本会定制 require 的解析,解析后缓存的文件路径会被格式化,导致 windows 平台路径不一致,导致 cache 不生效
if (require('os').platform() === 'win32') {
require('vue')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册