Skip to content
This repository was archived by the owner on Jun 8, 2022. It is now read-only.

Commit 1c4f736

Browse files
committed
Updated var declarations to let/const
1 parent f3a6fa9 commit 1c4f736

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

src/chunk-manifest-webpack-plugin.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use strict";
22

3-
var RawSource = require("webpack-sources").RawSource;
3+
const RawSource = require("webpack-sources").RawSource;
44

55
class ChunkManifestPlugin {
66
constructor(options) {
@@ -10,23 +10,27 @@ class ChunkManifestPlugin {
1010
}
1111

1212
apply(compiler) {
13-
var manifestFilename = this.manifestFilename;
14-
var manifestVariable = this.manifestVariable;
15-
var oldChunkFilename;
16-
var chunkManifest;
13+
const manifestFilename = this.manifestFilename;
14+
const manifestVariable = this.manifestVariable;
15+
let oldChunkFilename;
1716

1817
compiler.plugin("this-compilation", function(compilation) {
19-
var mainTemplate = compilation.mainTemplate;
18+
const mainTemplate = compilation.mainTemplate;
2019
mainTemplate.plugin("require-ensure", function(_, chunk, hash) {
21-
var filename =
20+
const filename =
2221
this.outputOptions.chunkFilename || this.outputOptions.filename;
2322

2423
if (filename) {
25-
chunkManifest = [chunk].reduce(function registerChunk(manifest, c) {
24+
const chunkManifest = [chunk].reduce(function registerChunk(
25+
manifest,
26+
c
27+
) {
2628
if (c.id in manifest) return manifest;
27-
var hasRuntime = typeof c.hasRuntime === "function"
29+
30+
const hasRuntime = typeof c.hasRuntime === "function"
2831
? c.hasRuntime()
2932
: c.entry;
33+
3034
if (hasRuntime) {
3135
manifest[c.id] = undefined;
3236
} else {

0 commit comments

Comments
 (0)