Skip to content
This repository has been archived by the owner on Apr 4, 2019. It is now read-only.

Commit

Permalink
force a reset of the 'globalReference' value
Browse files Browse the repository at this point in the history
  • Loading branch information
KyLeoHC committed Dec 22, 2016
1 parent f328b7b commit 1a61b62
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ InlineResourcePlugin.prototype.apply = function (compiler) {
Object.keys(globalReference).forEach(function (key) {
delete compilation.assets[key];
});
globalReference = {};
}
compilation.assets[template] = {
source: function () {
Expand All @@ -234,6 +233,12 @@ InlineResourcePlugin.prototype.apply = function (compiler) {
};
}
});

compiler.plugin('done', function () {
//force a reset of the 'globalReference' value
globalReference = {};
});

if (self.detectChange(compilation)) {
//if content has been changed
//just let other plugins know that we have already recompiled file
Expand All @@ -244,4 +249,4 @@ InlineResourcePlugin.prototype.apply = function (compiler) {
});
};

module.exports = InlineResourcePlugin;
module.exports = InlineResourcePlugin;

0 comments on commit 1a61b62

Please sign in to comment.