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

Version Path
ilog-0.4.1 node_modules/webpack/lib/NamedChunksPlugin.js
ilog-0.4.0 node_modules/webpack/lib/NamedChunksPlugin.js
ilog-0.3.3 node_modules/webpack/lib/NamedChunksPlugin.js
optimacms-0.4.3 spec/dummy/node_modules/@rails/webpacker/node_modules/webpack/node_modules/webpack/lib/NamedChunksPlugin.js
optimacms-0.4.3 spec/dummy/node_modules/@rails/webpacker/node_modules/webpack/lib/NamedChunksPlugin.js
optimacms-0.4.3 spec/dummy/node_modules/webpack/lib/NamedChunksPlugin.js
optimacms-0.4.2 spec/dummy/node_modules/@rails/webpacker/node_modules/webpack/lib/NamedChunksPlugin.js
optimacms-0.4.2 spec/dummy/node_modules/webpack/lib/NamedChunksPlugin.js
optimacms-0.4.2 spec/dummy/node_modules/@rails/webpacker/node_modules/webpack/node_modules/webpack/lib/NamedChunksPlugin.js
cortex-0.1.3 spec/dummy/node_modules/webpack/lib/NamedChunksPlugin.js