![JAR search and dependency download from the Maven repository](/logo.png)
package.lib.ids.NamedChunkIdsPlugin.js Maven / Gradle / Ivy
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const { compareChunksNatural } = require("../util/comparators");
const {
getShortChunkName,
getLongChunkName,
assignNames,
getUsedChunkIds,
assignAscendingChunkIds
} = require("./IdHelpers");
/** @typedef {import("../../declarations/WebpackOptions").OutputNormalized} Output */
/** @typedef {import("../Chunk")} Chunk */
/** @typedef {import("../Compiler")} Compiler */
/** @typedef {import("../Module")} Module */
/**
* @typedef {object} NamedChunkIdsPluginOptions
* @property {string} [context] context
* @property {string} [delimiter] delimiter
*/
class NamedChunkIdsPlugin {
/**
* @param {NamedChunkIdsPluginOptions=} options options
*/
constructor(options) {
this.delimiter = (options && options.delimiter) || "-";
this.context = options && options.context;
}
/**
* Apply the plugin
* @param {Compiler} compiler the compiler instance
* @returns {void}
*/
apply(compiler) {
compiler.hooks.compilation.tap("NamedChunkIdsPlugin", compilation => {
const hashFunction =
/** @type {NonNullable
© 2015 - 2025 Weber Informatics LLC | Privacy Policy