mirror of
https://github.com/caojiezi2003/clock-shop.git
synced 2024-11-13 23:49:45 +00:00
2abd64c041
replace path
24 lines
750 B
JavaScript
24 lines
750 B
JavaScript
var map = require('map-stream');
|
|
var vfs = require('vinyl-fs');
|
|
|
|
vfs.src(['./dist/css/*.css'])
|
|
.pipe(map(function (file, cb) {
|
|
var content = file.contents;
|
|
content = content.toString('utf8');
|
|
content = content.replace('/banner.jpg', '../banner.jpg').replace(/\/font\//ig, '../font/')
|
|
file.contents = Buffer.from(content);
|
|
|
|
cb(null, file);
|
|
}))
|
|
.pipe(vfs.dest('./dist/css/'));
|
|
|
|
vfs.src(['./dist/js/*.js'])
|
|
.pipe(map(function (file, cb) {
|
|
var content = file.contents;
|
|
content = content.toString('utf8');
|
|
content = content.replace('/data.yaml', './data.yaml');
|
|
file.contents = Buffer.from(content);
|
|
|
|
cb(null, file);
|
|
}))
|
|
.pipe(vfs.dest('./dist/js/')); |