Skip to content

Commit a1cfed3

Browse files
author
Nick Plekhanov
committed
Use template literlals
1 parent 344b82b commit a1cfed3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/ExtendedAPIPlugin.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@ class ExtendedAPIPlugin {
2121
compilation.dependencyFactories.set(ConstDependency, new NullFactory());
2222
compilation.dependencyTemplates.set(ConstDependency, new ConstDependency.Template());
2323
compilation.mainTemplate.plugin("require-extensions", function(source, chunk, hash) {
24-
var buf = [source];
24+
const buf = [source];
2525
buf.push("");
2626
buf.push("// __webpack_hash__");
27-
buf.push(this.requireFn + ".h = " + JSON.stringify(hash) + ";");
27+
buf.push(`${this.requireFn}.h = ${JSON.stringify(hash)};`);
2828
return this.asString(buf);
2929
});
3030
compilation.mainTemplate.plugin("global-hash", () => true);
3131

3232
params.normalModuleFactory.plugin("parser", (parser, parserOptions) => {
3333
Object.keys(REPLACEMENTS).forEach(key => {
34-
parser.plugin("expression " + key, ParserHelpers.toConstantDependency(REPLACEMENTS[key]));
35-
parser.plugin("evaluate typeof " + key, ParserHelpers.evaluateToString(REPLACEMENT_TYPES[key]));
34+
parser.plugin(`expression ${key}`, ParserHelpers.toConstantDependency(REPLACEMENTS[key]));
35+
parser.plugin(`evaluate typeof ${key}`, ParserHelpers.evaluateToString(REPLACEMENT_TYPES[key]));
3636
});
3737
});
3838
});

0 commit comments

Comments
 (0)