Skip to content

Commit

Permalink
Improve check for empty content
Browse files Browse the repository at this point in the history
This has been removed accidentally by a previous commit.
  • Loading branch information
jhnns committed Mar 7, 2017
1 parent 911a774 commit 462ae5f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const asyncSassJobQueue = async.queue(sass.render, threadPoolSize - 1);
* @param {string} content
*/
function sassLoader(content) {
content = content || '//';
const callback = this.async();
const isSync = typeof callback !== "function";
const self = this;
Expand All @@ -44,6 +43,12 @@ function sassLoader(content) {
addNormalizedDependency
));

// Skip empty files, otherwise it will stop webpack, see issue #21
if (options.data.trim() === "") {
callback(null, "");
return;
}

// start the actual rendering
asyncSassJobQueue.push(options, (err, result) => {
if (err) {
Expand Down

0 comments on commit 462ae5f

Please sign in to comment.