fix(cli): failed to import sfc after build

This commit is contained in:
chenjiahan
2020-12-03 16:21:59 +08:00
parent 764e9e2d69
commit ac856c2673
4 changed files with 20 additions and 8 deletions

View File

@@ -38,7 +38,7 @@ export function getCssBaseFile() {
const IMPORT_STYLE_RE = /import\s+?(?:(?:".*?")|(?:'.*?'))[\s]*?(?:;|$|)/g;
// "import 'a.less';" => "import 'a.css';"
export function replaceCssImport(code: string) {
export function replaceCssImportExt(code: string) {
return code.replace(IMPORT_STYLE_RE, str =>
str.replace(`.${CSS_LANG}`, '.css')
);