Apply suggestions from code review

Co-Authored-By: Tobias Koppers <tobias.koppers@googlemail.com>
This commit is contained in:
JJ Kasper 2019-07-23 10:37:07 -05:00 committed by GitHub
parent 362e5d37d6
commit d8754873f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -56,7 +56,7 @@ const getReplacer = (value, allowEmpty) => {
const escapePathVariables = value => {
return typeof value === "string"
? value.replace(
/\[(name|id|moduleid|file|query|filebase|url|hash|chunkhash|modulehash|contenthash)\]/g,
/\[(\\*[\w:]+\\*)\]/gi,
"[\\$1\\]"
)
: value;

View File

@ -231,14 +231,14 @@ describe("HotModuleReplacementPlugin", () => {
});
fs.writeFileSync(entryFile, "1", "utf-8");
compiler.run((err, stats) => {
if (err) throw err;
if (err) return done(err);
fs.writeFileSync(statsFile3, stats.toString());
compiler.run((err, stats) => {
if (err) throw err;
if (err) return done(err);
fs.writeFileSync(statsFile4, stats.toString());
fs.writeFileSync(entryFile, "2", "utf-8");
compiler.run((err, stats) => {
if (err) throw err;
if (err) return done(err);
fs.writeFileSync(statsFile3, stats.toString());
let foundUpdates = false;