chore: update css.js build #3678 (#3679)

pull/3700/head
zkwolf 2021-02-17 21:22:15 +08:00 committed by GitHub
parent 634dafce63
commit f1cf66fcc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -111,7 +111,10 @@ function babelify(js, modules) {
if (file.path.match(/\/style\/index\.(js|jsx|ts|tsx)$/)) {
const content = file.contents.toString(encoding);
file.contents = Buffer.from(
content.replace(/\/style\/?'/g, "/style/css'").replace(/\.less/g, '.css'),
content
.replace(/\/style\/?'/g, "/style/css'")
.replace(/\/style\/?"/g, '/style/css"')
.replace(/\.less/g, '.css'),
);
file.path = file.path.replace(/index\.(js|jsx|ts|tsx)$/, 'css.js');
this.push(file);