Skip to content

Commit

Permalink
Updated node-sass dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
dlmanning committed Feb 12, 2015
1 parent 5ee25e6 commit 314ce5c
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 26 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### 1.3.3

* updated to node-sass 2.0 (final)
* should now work with node 0.12 and io.js

### 1.3.2

* fixed errLogToConsole
Expand Down
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
[![Build Status](https://travis-ci.org/dlmanning/gulp-sass.svg?branch=master)](https://travis-ci.org/dlmanning/gulp-sass)


#Attention: Read this before posting an issue

At the moment gulp-sass will not work with node 0.12 or io.js. gulp-sass is just a wrapper around node-sass, which implements node bindings to libsass. The maintainers of node-sass are doing their best to finish version 2.0, which will include support for node 0.12 and io.js. In the meantime, there is nothing I can do to make gulp-sass work on on anything other that node 0.10.xx. If you need to run gulp-sass, don't upgrade node until node-sass 2.0 is finalized.

Thanks

gulp-sass
=========

Expand Down
22 changes: 13 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,25 @@ module.exports = function (options) {
opts.success = function (obj) {
if (typeof opts.onSuccess === 'function') opts.onSuccess(obj);

if (obj.map && obj.map.length || obj.map.version) {
if (obj.map && typeof obj.map === 'string') {
// hack to remove the already added sourceMappingURL from libsass
obj.css = obj.css.replace(/\/\*#\s*sourceMappingURL\=.*\*\//, '');

// libsass gives us sources' paths relative to file;
// gulp-sourcemaps needs sources' paths relative to file.base;
// so alter the sources' paths to please gulp-sourcemaps.
obj.map = obj.map.version ? obj.map : JSON.parse(obj.map);
obj.map.sources = obj.map.sources.map(function(source) {
var abs = path.resolve(path.dirname(file.path), source);
return path.relative(file.base, abs);
});
obj.map = JSON.stringify(obj.map);

applySourceMap(file, obj.map);
obj.map = JSON.parse(obj.map);

if (obj.map.sources) {
obj.map.sources = obj.map.sources.map(function(source) {
var abs = path.resolve(path.dirname(file.path), source);
return path.relative(file.base, abs);
});

obj.map = JSON.stringify(obj.map);
applySourceMap(file, obj.map);
}

}

handleOutput(obj, file, cb);
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gulp-sass",
"version": "1.3.2",
"version": "1.3.3",
"description": "Gulp plugin for sass",
"main": "index.js",
"scripts": {
Expand All @@ -24,7 +24,7 @@
"clone": "~0.1.18",
"gulp-util": "^3.0",
"map-stream": "~0.1",
"node-sass": "2.0.0-beta",
"node-sass": "^2.0.1",
"vinyl-sourcemaps-apply": "~0.1.1"
},
"devDependencies": {
Expand Down
17 changes: 9 additions & 8 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,15 @@ test('sourcemaps', function (t) {

// Pretend sourcemap.init() happened by mimicking
// the object it would create.
sassFile.sourceMap = {
version: 3,
file: 'scss/subdir/multilevelimport.scss',
names: [],
mappings: '',
sources: [ 'scss/subdir/multilevelimport.scss' ],
sourcesContent: [ '@import "../inheritance";\n' ]
};

sassFile.sourceMap = '{' +
'"version": 3,' +
'"file": "scss/subdir/multilevelimport.scss",' +
'"names": [],' +
'"mappings": "",' +
'"sources": [ "scss/subdir/multilevelimport.scss" ],' +
'"sourcesContent": [ "@import ../inheritance;" ]' +
'}';

// Expected sources are relative to file.base
var expectedSources = [
Expand Down

2 comments on commit 314ce5c

@sgtlambda
Copy link

Choose a reason for hiding this comment

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

hurray

@arthurvr
Copy link

Choose a reason for hiding this comment

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

Hurray!

Please sign in to comment.