Skip to content

Commit c655ec0

Browse files
authored
fix(build-plugin-lowcode): windows import path (alibaba#24)
1 parent 51e1561 commit c655ec0

File tree

1 file changed

+3
-2
lines changed
  • packages/build-plugin-lowcode/src

1 file changed

+3
-2
lines changed

packages/build-plugin-lowcode/src/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const defaultScssEntryPaths = [
6464

6565
function getEntry(rootDir, entryPath) {
6666
if (entryPath && fse.existsSync(path.resolve(rootDir, entryPath))) {
67-
return path.resolve(rootDir, entryPath);
67+
return path.resolve(rootDir, entryPath).replace(/\\/g, '\\\\');
6868
}
6969
for (let i = 0; i < defaultEntryPaths.length; i++) {
7070
const p = path.resolve(rootDir, defaultEntryPaths[i]);
@@ -957,7 +957,8 @@ async function bundleRenderView(options, pluginOptions, platform, execCompile) {
957957
return `const ${component} = getRealComponent(${component}Data, '${component}');\nexport { ${component} };`;
958958
})
959959
.join('\n');
960-
componentViewsExportStr += `\nexport { default } from '${getEntry(rootDir, entryPath)}';`;
960+
const exportPath = `\nexport { default } from '${getEntry(rootDir, entryPath)}';`;
961+
componentViewsExportStr += exportPath.includes('\\\\') ? exportPath : exportPath.replace(/\\/g, '\\\\');
961962
componentViewsImportStr = _componentViews
962963
.map((component) => {
963964
const componentNameFolder = camel2KebabComponentName(component);

0 commit comments

Comments
 (0)