Updated node-sass dependency
This commit is contained in:
parent
5ee25e68da
commit
314ce5c159
|
@ -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
|
### 1.3.2
|
||||||
|
|
||||||
* fixed errLogToConsole
|
* fixed errLogToConsole
|
||||||
|
|
|
@ -1,12 +1,5 @@
|
||||||
[![Build Status](https://travis-ci.org/dlmanning/gulp-sass.svg?branch=master)](https://travis-ci.org/dlmanning/gulp-sass)
|
[![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
|
gulp-sass
|
||||||
=========
|
=========
|
||||||
|
|
||||||
|
|
20
index.js
20
index.js
|
@ -39,21 +39,25 @@ module.exports = function (options) {
|
||||||
opts.success = function (obj) {
|
opts.success = function (obj) {
|
||||||
if (typeof opts.onSuccess === 'function') opts.onSuccess(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
|
// hack to remove the already added sourceMappingURL from libsass
|
||||||
obj.css = obj.css.replace(/\/\*#\s*sourceMappingURL\=.*\*\//, '');
|
obj.css = obj.css.replace(/\/\*#\s*sourceMappingURL\=.*\*\//, '');
|
||||||
|
|
||||||
// libsass gives us sources' paths relative to file;
|
// libsass gives us sources' paths relative to file;
|
||||||
// gulp-sourcemaps needs sources' paths relative to file.base;
|
// gulp-sourcemaps needs sources' paths relative to file.base;
|
||||||
// so alter the sources' paths to please gulp-sourcemaps.
|
// so alter the sources' paths to please gulp-sourcemaps.
|
||||||
obj.map = obj.map.version ? obj.map : JSON.parse(obj.map);
|
obj.map = JSON.parse(obj.map);
|
||||||
obj.map.sources = obj.map.sources.map(function(source) {
|
|
||||||
var abs = path.resolve(path.dirname(file.path), source);
|
if (obj.map.sources) {
|
||||||
return path.relative(file.base, abs);
|
obj.map.sources = obj.map.sources.map(function(source) {
|
||||||
});
|
var abs = path.resolve(path.dirname(file.path), source);
|
||||||
obj.map = JSON.stringify(obj.map);
|
return path.relative(file.base, abs);
|
||||||
|
});
|
||||||
|
|
||||||
|
obj.map = JSON.stringify(obj.map);
|
||||||
|
applySourceMap(file, obj.map);
|
||||||
|
}
|
||||||
|
|
||||||
applySourceMap(file, obj.map);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
handleOutput(obj, file, cb);
|
handleOutput(obj, file, cb);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "gulp-sass",
|
"name": "gulp-sass",
|
||||||
"version": "1.3.2",
|
"version": "1.3.3",
|
||||||
"description": "Gulp plugin for sass",
|
"description": "Gulp plugin for sass",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
"clone": "~0.1.18",
|
"clone": "~0.1.18",
|
||||||
"gulp-util": "^3.0",
|
"gulp-util": "^3.0",
|
||||||
"map-stream": "~0.1",
|
"map-stream": "~0.1",
|
||||||
"node-sass": "2.0.0-beta",
|
"node-sass": "^2.0.1",
|
||||||
"vinyl-sourcemaps-apply": "~0.1.1"
|
"vinyl-sourcemaps-apply": "~0.1.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
17
test/test.js
17
test/test.js
|
@ -170,14 +170,15 @@ test('sourcemaps', function (t) {
|
||||||
|
|
||||||
// Pretend sourcemap.init() happened by mimicking
|
// Pretend sourcemap.init() happened by mimicking
|
||||||
// the object it would create.
|
// the object it would create.
|
||||||
sassFile.sourceMap = {
|
|
||||||
version: 3,
|
sassFile.sourceMap = '{' +
|
||||||
file: 'scss/subdir/multilevelimport.scss',
|
'"version": 3,' +
|
||||||
names: [],
|
'"file": "scss/subdir/multilevelimport.scss",' +
|
||||||
mappings: '',
|
'"names": [],' +
|
||||||
sources: [ 'scss/subdir/multilevelimport.scss' ],
|
'"mappings": "",' +
|
||||||
sourcesContent: [ '@import "../inheritance";\n' ]
|
'"sources": [ "scss/subdir/multilevelimport.scss" ],' +
|
||||||
};
|
'"sourcesContent": [ "@import ../inheritance;" ]' +
|
||||||
|
'}';
|
||||||
|
|
||||||
// Expected sources are relative to file.base
|
// Expected sources are relative to file.base
|
||||||
var expectedSources = [
|
var expectedSources = [
|
||||||
|
|
Loading…
Reference in a new issue