Skip to content
This repository was archived by the owner on Nov 4, 2021. It is now read-only.

feat(scss): add sourcemaps to scss task #41

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion sass-build/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
var gulp = require('gulp'),
sass = require('gulp-sass'),
autoprefixer = require('gulp-autoprefixer')
sourcemaps = require('gulp-sourcemaps'),
assign = require('lodash.assign');

var defaultOptions = {
src: 'app/theme/app.+(ios|md|wp).scss',
dest: 'www/build/css',
debug: true,
sassOptions: {
includePaths: [
'node_modules/ionic-angular',
Expand All @@ -30,10 +32,12 @@ var defaultOptions = {

module.exports = function(options) {
options = assign(defaultOptions, options);

var debug = options.debug;
return gulp.src(options.src)
.pipe(debug ? sourcemaps.init() : noop())

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line throws because debug is not defined. I think this should read
.pipe(options.debug ? ...

.pipe(sass(options.sassOptions))
.on('error', options.onError)
.pipe(autoprefixer(options.autoprefixerOptions))
.pipe(debug ? sourcemaps.write('./') : noop())

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similarly I think this line should be
.pipe(options.debug ? ...

.pipe(gulp.dest(options.dest));
}
5 changes: 3 additions & 2 deletions sass-build/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ionic-gulp-sass-build",
"description": "Gulp task for Ionic projects to compile Sass sources into CSS",
"version": "1.0.0",
"version": "1.1.0",
"license": "MIT",
"repository": {
"type": "git",
Expand All @@ -11,6 +11,7 @@
"gulp": "^3.9.1",
"gulp-autoprefixer": "^3.1.0",
"gulp-sass": "^2.2.0",
"lodash.assign": "^4.0.6"
"lodash.assign": "^4.0.6",
"gulp-sourcemaps": "^1.6.0"
}
}