提交 edf77078 编写于 作者: Q qiang

fix: 修复混合分包在 win 上依赖路径错误的问题

上级 867b3c6d
......@@ -4,7 +4,7 @@ const webpack = require('webpack')
const {
parseEntry,
getMainEntry,
// normalizePath,
normalizePath,
getPlatformExts,
getPlatformCssnano
} = require('@dcloudio/uni-cli-shared')
......@@ -70,7 +70,7 @@ function getProvides () {
function processWxss (name, assets) {
const dirname = path.dirname(name)
const mainWxssCode = `@import "${path.relative(dirname, 'common/main.wxss')}";`
const mainWxssCode = `@import "${normalizePath(path.relative(dirname, 'common/main.wxss'))}";`
const code = `${mainWxssCode}` + assets[name].source().toString()
assets[name] = {
size () {
......@@ -84,9 +84,9 @@ function processWxss (name, assets) {
function procssJs (name, assets, hasVendor) {
const dirname = path.dirname(name)
const runtimeJsCode = `require('${path.relative(dirname, 'common/runtime.js')}');`
const vendorJsCode = hasVendor ? `require('${path.relative(dirname, 'common/vendor.js')}');` : ''
const mainJsCode = `require('${path.relative(dirname, 'common/main.js')}');`
const runtimeJsCode = `require('${normalizePath(path.relative(dirname, 'common/runtime.js'))}');`
const vendorJsCode = hasVendor ? `require('${normalizePath(path.relative(dirname, 'common/vendor.js'))}');` : ''
const mainJsCode = `require('${normalizePath(path.relative(dirname, 'common/main.js'))}');`
const code = `${runtimeJsCode}${vendorJsCode}${mainJsCode}` + assets[name].source().toString()
assets[name] = {
size () {
......@@ -282,4 +282,4 @@ module.exports = {
webpackConfig.plugins.delete('preload')
webpackConfig.plugins.delete('prefetch')
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册