Skip to content

Commit b2638d2

Browse files
committed
Revert "cache the replaced source for performance"
This cannot be cached because module ids may change. This reverts commit 8a7b508. fixes danez/grunt-webpack#19
1 parent 65ac850 commit b2638d2

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

‎lib/NormalModule.js‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ NormalModule.prototype.build = function build(options, compilation, resolver, fs
6666
this.dependencies.length = 0;
6767
this.variables.length = 0;
6868
this.blocks.length = 0;
69-
this._cachedSource = null;
7069
if(options.module && options.module.noParse) {
7170
if(Array.isArray(options.module.noParse)) {
7271
if(options.module.noParse.some(function(regExp) {
@@ -97,10 +96,9 @@ NormalModule.prototype.build = function build(options, compilation, resolver, fs
9796
};
9897

9998
NormalModule.prototype.source = function(dependencyTemplates, outputOptions, requestShortener) {
100-
if(this._cachedSource) return this._cachedSource;
10199
var _source = this._source;
102100
if(!_source) return new RawSource("throw new Error('No source availible');");
103-
var source = this._cachedSource = new ReplaceSource(_source);
101+
var source = new ReplaceSource(_source);
104102
var topLevelBlock = this;
105103
function doDep(dep) {
106104
var template = dependencyTemplates.get(dep.Class);

0 commit comments

Comments
 (0)