From cd7a178e115f15de24e29bec14ef948bc651a6a9 Mon Sep 17 00:00:00 2001 From: Andreas Deuschlinger Date: Fri, 17 Feb 2017 09:40:00 +0100 Subject: [PATCH 1/5] fixed error was not forwarded --- index.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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); From 96e9e1e7b743653608bf9ee087a1d76b7da119dd Mon Sep 17 00:00:00 2001 From: Andreas Deuschlinger Date: Fri, 17 Feb 2017 10:45:43 +0100 Subject: [PATCH 2/5] added test --- tests/main.js | 12 ++++++++++++ tests/sass/import-not-found.scss | 1 + 2 files changed, 13 insertions(+) create mode 100644 tests/sass/import-not-found.scss 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'; From db5f46f4dc7f3440c7d211d5b902cdc392198104 Mon Sep 17 00:00:00 2001 From: Andreas Deuschlinger Date: Fri, 17 Feb 2017 17:02:41 +0100 Subject: [PATCH 3/5] updated changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f1ba3f..3c34474 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Import Once Changelog +## v1.2.1 +### February 17, 2017 +* **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 From 458c11231c640a4184374046702ac3df8a0d1237 Mon Sep 17 00:00:00 2001 From: Andreas Deuschlinger Date: Fri, 17 Feb 2017 17:03:39 +0100 Subject: [PATCH 4/5] publish by axa-ch org --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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", From 4139e6965034af5ae3d28e206233512971eaa8c4 Mon Sep 17 00:00:00 2001 From: Andreas Deuschlinger Date: Fri, 17 Feb 2017 17:04:25 +0100 Subject: [PATCH 5/5] updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c34474..9d3618b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## 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