From a3b305951266b68b3c8e50ca0ba72f640e581f4a Mon Sep 17 00:00:00 2001 From: qiang Date: Sun, 27 Sep 2020 17:34:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20Windows=20=E4=B8=8A?= =?UTF-8?q?=E5=A4=B4=E6=9D=A1=E5=B0=8F=E7=A8=8B=E5=BA=8F=E4=BD=9C=E7=94=A8?= =?UTF-8?q?=E5=9F=9F=E6=8F=92=E6=A7=BD=EF=BC=88=E8=A7=A3=E6=9E=84=E6=8F=92?= =?UTF-8?q?=E6=A7=BD=EF=BC=89=E4=B8=8D=E6=98=BE=E7=A4=BA=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../webpack-uni-mp-loader/lib/plugin/generate-component.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/webpack-uni-mp-loader/lib/plugin/generate-component.js b/packages/webpack-uni-mp-loader/lib/plugin/generate-component.js index 31dea9505..1e017f995 100644 --- a/packages/webpack-uni-mp-loader/lib/plugin/generate-component.js +++ b/packages/webpack-uni-mp-loader/lib/plugin/generate-component.js @@ -133,7 +133,7 @@ module.exports = function generateComponent (compilation) { origSource = origSource.trim ? origSource.trim() : '' const result = origSource.match(/^@import ["'](.+?)["']$/) if (result) { - const stylePath = path.join(path.dirname(name), result[1]) + const stylePath = normalizePath(path.join(path.dirname(name), result[1])) if (Object.keys(assets).includes(stylePath)) { styleImports[stylePath] = styleImports[stylePath] || [] styleImports[stylePath].push(name) @@ -155,7 +155,7 @@ module.exports = function generateComponent (compilation) { if (json) { const data = JSON.parse(json) const usingComponents = data.usingComponents || {} - const componentPath = path.relative('/', usingComponents[parentName]) + const componentPath = normalizePath(path.relative('/', usingComponents[parentName])) const slots = fixSlots[componentPath] = fixSlots[componentPath] || {} const slot = slots[slotName] = slots[slotName] || {} slot[componentName] = '/' + name.replace(fixExtname, '') -- GitLab