From bbff7403fbf46f9ad92240ac213df8d30ef31b64 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 20 Sep 2018 02:56:13 +0200 Subject: update packages --- node_modules/webpack/lib/NamedChunksPlugin.js | 59 +++++++++++++-------------- 1 file changed, 29 insertions(+), 30 deletions(-) (limited to 'node_modules/webpack/lib/NamedChunksPlugin.js') diff --git a/node_modules/webpack/lib/NamedChunksPlugin.js b/node_modules/webpack/lib/NamedChunksPlugin.js index 10f99530f..0cb5b6bf3 100644 --- a/node_modules/webpack/lib/NamedChunksPlugin.js +++ b/node_modules/webpack/lib/NamedChunksPlugin.js @@ -1,30 +1,29 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -"use strict"; - -class NamedChunksPlugin { - - static defaultNameResolver(chunk) { - return chunk.name || null; - } - - constructor(nameResolver) { - this.nameResolver = nameResolver || NamedChunksPlugin.defaultNameResolver; - } - - apply(compiler) { - compiler.plugin("compilation", (compilation) => { - compilation.plugin("before-chunk-ids", (chunks) => { - chunks.forEach((chunk) => { - if(chunk.id === null) { - chunk.id = this.nameResolver(chunk); - } - }); - }); - }); - } -} - -module.exports = NamedChunksPlugin; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +class NamedChunksPlugin { + static defaultNameResolver(chunk) { + return chunk.name || null; + } + + constructor(nameResolver) { + this.nameResolver = nameResolver || NamedChunksPlugin.defaultNameResolver; + } + + apply(compiler) { + compiler.hooks.compilation.tap("NamedChunksPlugin", compilation => { + compilation.hooks.beforeChunkIds.tap("NamedChunksPlugin", chunks => { + for (const chunk of chunks) { + if (chunk.id === null) { + chunk.id = this.nameResolver(chunk); + } + } + }); + }); + } +} + +module.exports = NamedChunksPlugin; -- cgit v1.2.3