提交 656a8107 编写于 作者: L liaofeiyin 提交者: qiang

fix(webpack-uni-app-loader): require 相对路径错误

上级 31e2e9b3
......@@ -47,9 +47,11 @@ function addSubPackagesRequire (compilation) {
name.indexOf(root + '/') === 0 &&
name !== subPackageVendorPath
) {
const source =
`require('${normalizePath(path.relative(path.dirname(name), subPackageVendorPath))}');` +
compilation.assets[name].source()
let relativePath = normalizePath(path.relative(path.dirname(name), subPackageVendorPath))
if (!relativePath.startsWith('.')) {
relativePath = './' + relativePath
}
const source = `require('${relativePath}');` + compilation.assets[name].source()
compilation.assets[name] = {
size () {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册