Skip to content

Commit

Permalink
Merge pull request #14 from dnlup/master
Browse files Browse the repository at this point in the history
Using Errors instead of string messages
  • Loading branch information
aackerman committed Apr 18, 2017
2 parents b15282c + 2eddd42 commit 0f959f2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ CircularDependencyPlugin.prototype.apply = function(compiler) {
var cyclePath = isCyclic(module, module, {});
if (cyclePath) {
var relativePathToModule = path.relative(process.cwd(), module.resource);
var msg = 'Circular dependency detected:\r\n'.concat(cyclePath.join(' -> '));
var error = new Error('Circular dependency detected:\r\n'.concat(cyclePath.join(' -> ')));
if (plugin.options.failOnError) {
stats.compilation.errors.push(msg);
stats.compilation.errors.push(error);
} else {
stats.compilation.warnings.push(msg);
stats.compilation.warnings.push(error);
}
}
});
Expand Down

0 comments on commit 0f959f2

Please sign in to comment.