2
0

rename-src-to-dest-scss.js 704 B

1234567891011121314151617181920
  1. var path = require('path');
  2. var rename = require('gulp-rename');
  3. var config = require('../config');
  4. /**
  5. * Returns a configured gulp-rename to pipe from asset sources to dest.
  6. * Usage: .pipe(renameSrcToDestScss())
  7. */
  8. var renameSrcToDestScss = function(log) {
  9. return rename(function(filePath) {
  10. if (log) console.log(filePath.dirname + path.sep + filePath.basename + filePath.extname);
  11. filePath.dirname = filePath.dirname.replace(
  12. path.sep + config.srcDir + path.sep,
  13. path.sep + config.destDir + path.sep
  14. ).replace(path.sep + "scss", path.sep + "css");
  15. if (log) console.log(filePath.dirname);
  16. });
  17. };
  18. module.exports = renameSrcToDestScss;