|
|
|
@ -78,12 +78,12 @@ function babelify (js, modules) {
|
|
|
|
|
let stream = js.pipe(babel(babelConfig)) |
|
|
|
|
.pipe(through2.obj(function z (file, encoding, next) { |
|
|
|
|
this.push(file.clone()) |
|
|
|
|
if (file.path.match(/\/style\/index\.js/)) { |
|
|
|
|
if (file.path.match(/\/style\/index\.(js|jsx)$/)) { |
|
|
|
|
const content = file.contents.toString(encoding) |
|
|
|
|
file.contents = Buffer.from(content |
|
|
|
|
.replace(/\/style\/?'/g, '/style/css\'') |
|
|
|
|
.replace(/\.less/g, '.css')) |
|
|
|
|
file.path = file.path.replace(/index\.js/, 'css.js') |
|
|
|
|
file.path = file.path.replace(/index\.(js|jsx)$/, 'css.js') |
|
|
|
|
this.push(file) |
|
|
|
|
next() |
|
|
|
|
} else { |
|
|
|
|