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
@@ -1,6 +1,6 @@
import { get } from 'lodash';
import { join } from 'path';
import { pascalize, getComponents, smartOutputFile } from '../common';
import { pascalize, getComponents, smartOutputFile, normalizePath } from '../common';
import { SRC_DIR, getPackageJson, getVantConfig } from '../common/constant';
type Options = {
@@ -16,7 +16,7 @@ function genImports(components: string[], options: Options): string {
path = options.pathResolver(path);
}
return `import ${pascalize(name)} from '${path}';`;
return `import ${pascalize(name)} from '${normalizePath(path)}';`;
})
.join('\n');
}