From 464e730143b8b544587d3ed90015cd3408e9cd42 Mon Sep 17 00:00:00 2001 From: yutent Date: Thu, 20 Apr 2023 15:32:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BC=96=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/main.js | 9 ++++----- package.json | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/main.js b/lib/main.js index a3f2abc..7808038 100644 --- a/lib/main.js +++ b/lib/main.js @@ -31,16 +31,15 @@ function parse(origin, target, name) { let code = fs.cat(origin).toString() console.log('编译 %s ...', blue(name)) try { + code = code.replace(/css`([\w\W]*?)`/g, function (m, scss) { + scss = compileScss(scss) + return `css\`${scss}\`` + }) code = Es.transformSync(code, OPTIONS).code } catch (err) { console.log('compile scss: ', name) console.error(err) } - - code = code.replace(/css`([\w\W]*?)`/g, function (m, scss) { - scss = compileScss(scss) - return `css\`${scss}\`` - }) fs.echo(code, target) } break diff --git a/package.json b/package.json index 94498bb..4907c79 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@bd/wcui-cli", "type": "module", - "version": "1.2.2", + "version": "1.2.3", "bin": { "wcui-cli": "index.js" },