Skip to content

Commit b1b85ed

Browse files
author
zhouhuafei
committed
fix: filter out the comments of sass
1 parent 6fb8aa3 commit b1b85ed

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.idea
12
dist/
23
.DS_Store
34
node_modules/

src/app/converter/converter.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,11 @@ export class Converter {
8686

8787
let contents = inputs.map((filePath) => fs.readFileSync(String(filePath)));
8888

89-
return contents.join(LINE_BREAK);
89+
let strContents = contents.join(LINE_BREAK);
90+
strContents = strContents.replace(/\/\*[\w\W\r\n]*?\*\//g, '');
91+
strContents = strContents.split(LINE_BREAK).filter(v=> v.indexOf('//') === -1).join(LINE_BREAK);
92+
93+
return strContents;
9094
}
9195

9296

0 commit comments

Comments
 (0)