Updated node-sass dependency

release/2.0.1 v1.3.3
David Manning 2015-02-12 13:49:11 -08:00
parent 5ee25e68da
commit 314ce5c159
5 changed files with 28 additions and 25 deletions

View File

@ -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

View File

@ -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
=========

View File

@ -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);
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);
}
applySourceMap(file, obj.map);
}
handleOutput(obj, file, cb);

View File

@ -1,6 +1,6 @@
{
"name": "gulp-sass",
"version": "1.3.2",
"version": "1.3.3",
"description": "Gulp plugin for sass",
"main": "index.js",
"scripts": {
@ -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": {

View File

@ -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 = [