0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-25 13:10:14 +01:00
wagtail/gulpfile.js/lib/rename-src-to-dest-scss.js
2021-10-01 16:25:29 +01:00

21 lines
704 B
JavaScript

var path = require('path');
var rename = require('gulp-rename');
var config = require('../config');
/**
* Returns a configured gulp-rename to pipe from asset sources to dest.
* Usage: .pipe(renameSrcToDestScss())
*/
var renameSrcToDestScss = function(log) {
return rename(function(filePath) {
if (log) console.log(filePath.dirname + path.sep + filePath.basename + filePath.extname);
filePath.dirname = filePath.dirname.replace(
path.sep + config.srcDir + path.sep,
path.sep + config.destDir + path.sep
).replace(path.sep + "scss", path.sep + "css");
if (log) console.log(filePath.dirname);
});
};
module.exports = renameSrcToDestScss;