diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f1ba3f..9d3618b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Import Once Changelog +## v1.2.1 +### February 17, 2017 +* **New** Published withing `@axa-ch` org +* **Bugfix** Fixed error wern't passed properly to `node-sass` + ## v1.1.1 ### March 26, 2015 * **New** Added support for files passed in as strings instead of as file paths diff --git a/index.js b/index.js index 8c02aac..471a691 100644 --- a/index.js +++ b/index.js @@ -308,8 +308,7 @@ var importer = function importer(uri, prev, done) { file = path.resolve(path.dirname(prev), makeFsPath(uri)); raf(uri, file, function (err, data) { if (err) { - console.log(err.toString()); - done({}); + done(err); } else { io(data, done); @@ -319,8 +318,7 @@ var importer = function importer(uri, prev, done) { else { raf(uri, process.cwd(), function (err, data) { if (err) { - console.log(err.toString()); - done({}); + done(err); } else { io(data, done); diff --git a/package.json b/package.json index 69ecdbf..8110401 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "node-sass-import-once", + "name": "@axa-ch/node-sass-import-once", "version": "1.2.0", "description": "Custom importer for node-sass that only allows a file to be imported once. Includes additional import bonuses including importing CSS files directly into Sass, automagic Bower imports, the ability to import an `index` file from within a folder name, and the ability to import JSON and YAML files as Sass maps. Inspired by Eyeglass.", "main": "index.js", diff --git a/tests/main.js b/tests/main.js index 2fdf5dc..21bc9f5 100644 --- a/tests/main.js +++ b/tests/main.js @@ -284,4 +284,16 @@ describe('import-once', function () { done(); }); }); + + it('should forward import errors to node-sass', function (done) { + var file = filePath('import-not-found.scss'); + + sass.render({ + 'file': file, + 'importer': importer + }, function (err, result) { + should.exist(err); + done(); + }); + }); }); diff --git a/tests/sass/import-not-found.scss b/tests/sass/import-not-found.scss new file mode 100644 index 0000000..4cb7e21 --- /dev/null +++ b/tests/sass/import-not-found.scss @@ -0,0 +1 @@ +@import 'could-not-find.scss';