|
|
@ -78,12 +78,12 @@ function babelify (js, modules) { |
|
|
|
let stream = js.pipe(babel(babelConfig)) |
|
|
|
let stream = js.pipe(babel(babelConfig)) |
|
|
|
.pipe(through2.obj(function z (file, encoding, next) { |
|
|
|
.pipe(through2.obj(function z (file, encoding, next) { |
|
|
|
this.push(file.clone()) |
|
|
|
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) |
|
|
|
const content = file.contents.toString(encoding) |
|
|
|
file.contents = Buffer.from(content |
|
|
|
file.contents = Buffer.from(content |
|
|
|
.replace(/\/style\/?'/g, '/style/css\'') |
|
|
|
.replace(/\/style\/?'/g, '/style/css\'') |
|
|
|
.replace(/\.less/g, '.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) |
|
|
|
this.push(file) |
|
|
|
next() |
|
|
|
next() |
|
|
|
} else { |
|
|
|
} else { |
|
|
|