Skip to content

Commit

Permalink
Merge pull request webpack#11381 from webpack/cache/no-parse
Browse files Browse the repository at this point in the history
cache modules even if they are not parsed
  • Loading branch information
sokra authored Aug 26, 2020
2 parents 34854cc + 338f7d4 commit bdf4a2b
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lib/NormalModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -770,16 +770,6 @@ class NormalModule extends Module {
return callback();
}

// check if this module should !not! be parsed.
// if so, exit here;
const noParseRule = options.module && options.module.noParse;
if (this.shouldPreventParsing(noParseRule, this.request)) {
// We assume that we need module and exports
this.buildInfo.parsed = false;
this._initBuildHash(compilation);
return callback();
}

const handleParseError = e => {
const source = this._source.source();
const loaders = this.loaders.map(item =>
Expand Down Expand Up @@ -829,6 +819,16 @@ class NormalModule extends Module {
);
};

// check if this module should !not! be parsed.
// if so, exit here;
const noParseRule = options.module && options.module.noParse;
if (this.shouldPreventParsing(noParseRule, this.request)) {
// We assume that we need module and exports
this.buildInfo.parsed = false;
this._initBuildHash(compilation);
return handleBuildDone();
}

let result;
try {
result = this.parser.parse(this._ast || this._source.source(), {
Expand Down

0 comments on commit bdf4a2b

Please sign in to comment.