From 8090c853ba2bb2fa669dd66ddc81b39cbc72d021 Mon Sep 17 00:00:00 2001 From: Keivan Beigi Date: Tue, 11 Aug 2015 10:44:05 -0700 Subject: [PATCH] Added source map to css files --- gulp/less.js | 5 ++++- gulp/webpack.js | 6 +++--- package.json | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gulp/less.js b/gulp/less.js index 2511c432e..fef218f45 100644 --- a/gulp/less.js +++ b/gulp/less.js @@ -1,5 +1,6 @@ var gulp = require('gulp'); var less = require('gulp-less'); +var sourcemaps = require('gulp-sourcemaps'); var print = require('gulp-print'); var phantom = require('./phantom'); var livereload = require('gulp-livereload'); @@ -33,7 +34,7 @@ gulp.task('less', function() { paths.src.content + 'overrides.less', paths.src.root + 'Series/series.less', paths.src.root + 'Activity/activity.less', - paths.src.root + 'AddSeries/addSeries.less', + paths.src.root + 'AddSeries/AddSeries.less', paths.src.root + 'Calendar/calendar.less', paths.src.root + 'Cells/cells.less', paths.src.root + 'ManualImport/manualimport.less', @@ -46,6 +47,7 @@ gulp.task('less', function() { return gulp.src(src) .pipe(print()) + .pipe(sourcemaps.init()) .pipe(less({ dumpLineNumbers : 'false', compress : true, @@ -54,6 +56,7 @@ gulp.task('less', function() { strictImports : true })) .on('error', errorHandler.onError) + .pipe(sourcemaps.write()) .pipe(gulp.dest(paths.dest.content)) .pipe(livereload()); }); diff --git a/gulp/webpack.js b/gulp/webpack.js index 22a335949..c5f23df9d 100644 --- a/gulp/webpack.js +++ b/gulp/webpack.js @@ -1,15 +1,15 @@ var gulp = require('gulp'); -var gulpWebpack = require('webpack-stream'); +var webpackStream = require('webpack-stream'); var livereload = require('gulp-livereload'); var webpackConfig = require('../webpack.config'); webpackConfig.devtool = "#source-map"; gulp.task('webpack', function() { - return gulp.src('main.js').pipe(gulpWebpack(webpackConfig)).pipe(gulp.dest('')); + return gulp.src('main.js').pipe(webpackStream(webpackConfig)).pipe(gulp.dest('')); }); gulp.task('webpackWatch', function() { webpackConfig.watch = true; - return gulp.src('main.js').pipe(gulpWebpack(webpackConfig)).pipe(gulp.dest('')).pipe(livereload()); + return gulp.src('main.js').pipe(webpackStream(webpackConfig)).pipe(gulp.dest('')).pipe(livereload()); }); diff --git a/package.json b/package.json index 474697631..a1517b5d6 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "gulp-print": "1.1.0", "gulp-replace": "0.5.3", "gulp-run": "1.6.8", + "gulp-sourcemaps": "1.5.2", "gulp-stripbom": "1.0.4", "gulp-webpack": "1.5.0", "gulp-wrap": "0.11.0",