Commit 4fdb52fa authored by Philipp Nowinski's avatar Philipp Nowinski
Browse files

[FEATURE] make embedding of sourcemaps configurable and change default behaviour

parent 521e1b6b
......@@ -43,11 +43,15 @@ function processCss() {
.pipe(filter.restore)
.pipe(gulp.dest(settings.getPath() + '/' + config.directories.css));
} else {
let sourcemapsPath;
if (config.directories.hasOwnProperty('cssSourceMaps') && config.directories.cssSourceMaps !== 'inline') {
sourcemapsPath = path.relative(settings.getPath() + '/' + config.directories.css, settings.getPath() + '/' + config.directories.cssSourceMaps);
}
return gulp.src([settings.getPath() + '/' + config.directories.sass + '/**/*.scss', '!**/*scsslint_tmp*.scss'], {since: gulp.lastRun('css')})
.pipe(plugins.sourcemaps.init())
.pipe(compilationProcess())
.on('error', plugins.sass.logError)
.pipe(plugins.sourcemaps.write(path.relative(settings.getPath() + '/' + config.directories.css, settings.getPath() + '/' + config.directories.cssSourceMaps)))
.pipe(plugins.sourcemaps.write(sourcemapsPath))
.pipe(filter)
.pipe(plugins.checkFilesize({
enableGzip: true
......
......@@ -42,6 +42,10 @@ module.exports = function() {
}))
.pipe(gulp.dest(settings.getPath() + '/' + config.directories.javascriptDest));
} else {
let sourcemapsPath;
if (config.directories.hasOwnProperty('javascriptSourceMaps') && config.directories.javascriptSourceMaps !== 'inline') {
sourcemapsPath = path.relative(settings.getPath() + '/' + config.directories.javascriptDest, settings.getPath() + '/' + config.directories.javascriptSourceMaps);
}
return browserify.transform(babelify.configure({
presets: [require('babel-preset-es2015')]
}))
......@@ -58,7 +62,7 @@ module.exports = function() {
.pipe(plugins.checkFilesize({
enableGzip: true
}))
.pipe(plugins.sourcemaps.write(path.relative(settings.getPath() + '/' + config.directories.javascriptDest, settings.getPath() + '/' + config.directories.javascriptSourceMaps)))
.pipe(plugins.sourcemaps.write(sourcemapsPath))
.pipe(gulp.dest(settings.getPath() + '/' + config.directories.javascriptDest));
}
});
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment