Sha256: 098e9b45a2eb472a7efba767921e4ab4b45748513a1c7da0c7b4e59084dee4fd
Contents?: true
Size: 653 Bytes
Versions: 10
Compression:
Stored size: 653 Bytes
Contents
/* 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;
Version data entries
10 entries across 6 versions & 3 rubygems