fix(vant-cli): replace \ to / in path #5431 (#5473)

This commit is contained in:
jczzq
2020-01-05 09:48:49 +08:00
committed by neverland
parent 04f67f16bc
commit 4424b77cbc
5 changed files with 18 additions and 12 deletions
@@ -6,7 +6,8 @@ import {
removeExt,
decamelize,
getVantConfig,
smartOutputFile
smartOutputFile,
normalizePath
} from '../common';
type DemoItem = {
@@ -24,7 +25,7 @@ import './package-style';
function genImports(demos: DemoItem[]) {
return demos
.map(item => `import ${item.name} from '${removeExt(item.path)}';`)
.map(item => `import ${item.name} from '${removeExt(normalizePath(item.path))}';`)
.join('\n');
}