From edf770780098eb20ce78ccd824fa30af885fbaa9 Mon Sep 17 00:00:00 2001 From: qiang Date: Thu, 11 Mar 2021 15:29:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=B7=B7=E5=90=88?= =?UTF-8?q?=E5=88=86=E5=8C=85=E5=9C=A8=20win=20=E4=B8=8A=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/vue-cli-plugin-uni/lib/mp/index.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/vue-cli-plugin-uni/lib/mp/index.js b/packages/vue-cli-plugin-uni/lib/mp/index.js index cc15f8002..8b9ee13c2 100644 --- a/packages/vue-cli-plugin-uni/lib/mp/index.js +++ b/packages/vue-cli-plugin-uni/lib/mp/index.js @@ -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') } -} +} -- GitLab