summaryrefslogtreecommitdiff
path: root/node_modules/webpack/lib/ChunkTemplate.js
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2023-11-05 17:23:37 +0800
committerlittleblack111 <littleblack11111@gmail.com>2023-11-05 17:23:37 +0800
commit2cdf0cb352ab6a2d0f8cb25120e4ebc92c5316e3 (patch)
tree6b088c99810bd013f17b80522c936ca6dfc09858 /node_modules/webpack/lib/ChunkTemplate.js
parentf8ee6ef722e6c560c4a1c879e04dbdf0b01f0316 (diff)
removed autoprefix hover as it will have a high chance of making hover stopped working
Diffstat (limited to 'node_modules/webpack/lib/ChunkTemplate.js')
-rw-r--r--node_modules/webpack/lib/ChunkTemplate.js138
1 files changed, 0 insertions, 138 deletions
diff --git a/node_modules/webpack/lib/ChunkTemplate.js b/node_modules/webpack/lib/ChunkTemplate.js
deleted file mode 100644
index e98280f5..00000000
--- a/node_modules/webpack/lib/ChunkTemplate.js
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- MIT License http://www.opensource.org/licenses/mit-license.php
- Author Tobias Koppers @sokra
-*/
-
-"use strict";
-
-const util = require("util");
-const memoize = require("./util/memoize");
-
-/** @typedef {import("../declarations/WebpackOptions").Output} OutputOptions */
-/** @typedef {import("./Compilation")} Compilation */
-
-const getJavascriptModulesPlugin = memoize(() =>
- require("./javascript/JavascriptModulesPlugin")
-);
-
-// TODO webpack 6 remove this class
-class ChunkTemplate {
- /**
- * @param {OutputOptions} outputOptions output options
- * @param {Compilation} compilation the compilation
- */
- constructor(outputOptions, compilation) {
- this._outputOptions = outputOptions || {};
- this.hooks = Object.freeze({
- renderManifest: {
- tap: util.deprecate(
- (options, fn) => {
- compilation.hooks.renderManifest.tap(
- options,
- (entries, options) => {
- if (options.chunk.hasRuntime()) return entries;
- return fn(entries, options);
- }
- );
- },
- "ChunkTemplate.hooks.renderManifest is deprecated (use Compilation.hooks.renderManifest instead)",
- "DEP_WEBPACK_CHUNK_TEMPLATE_RENDER_MANIFEST"
- )
- },
- modules: {
- tap: util.deprecate(
- (options, fn) => {
- getJavascriptModulesPlugin()
- .getCompilationHooks(compilation)
- .renderChunk.tap(options, (source, renderContext) =>
- fn(
- source,
- compilation.moduleTemplates.javascript,
- renderContext
- )
- );
- },
- "ChunkTemplate.hooks.modules is deprecated (use JavascriptModulesPlugin.getCompilationHooks().renderChunk instead)",
- "DEP_WEBPACK_CHUNK_TEMPLATE_MODULES"
- )
- },
- render: {
- tap: util.deprecate(
- (options, fn) => {
- getJavascriptModulesPlugin()
- .getCompilationHooks(compilation)
- .renderChunk.tap(options, (source, renderContext) =>
- fn(
- source,
- compilation.moduleTemplates.javascript,
- renderContext
- )
- );
- },
- "ChunkTemplate.hooks.render is deprecated (use JavascriptModulesPlugin.getCompilationHooks().renderChunk instead)",
- "DEP_WEBPACK_CHUNK_TEMPLATE_RENDER"
- )
- },
- renderWithEntry: {
- tap: util.deprecate(
- (options, fn) => {
- getJavascriptModulesPlugin()
- .getCompilationHooks(compilation)
- .render.tap(options, (source, renderContext) => {
- if (
- renderContext.chunkGraph.getNumberOfEntryModules(
- renderContext.chunk
- ) === 0 ||
- renderContext.chunk.hasRuntime()
- ) {
- return source;
- }
- return fn(source, renderContext.chunk);
- });
- },
- "ChunkTemplate.hooks.renderWithEntry is deprecated (use JavascriptModulesPlugin.getCompilationHooks().render instead)",
- "DEP_WEBPACK_CHUNK_TEMPLATE_RENDER_WITH_ENTRY"
- )
- },
- hash: {
- tap: util.deprecate(
- (options, fn) => {
- compilation.hooks.fullHash.tap(options, fn);
- },
- "ChunkTemplate.hooks.hash is deprecated (use Compilation.hooks.fullHash instead)",
- "DEP_WEBPACK_CHUNK_TEMPLATE_HASH"
- )
- },
- hashForChunk: {
- tap: util.deprecate(
- (options, fn) => {
- getJavascriptModulesPlugin()
- .getCompilationHooks(compilation)
- .chunkHash.tap(options, (chunk, hash, context) => {
- if (chunk.hasRuntime()) return;
- fn(hash, chunk, context);
- });
- },
- "ChunkTemplate.hooks.hashForChunk is deprecated (use JavascriptModulesPlugin.getCompilationHooks().chunkHash instead)",
- "DEP_WEBPACK_CHUNK_TEMPLATE_HASH_FOR_CHUNK"
- )
- }
- });
- }
-}
-
-Object.defineProperty(ChunkTemplate.prototype, "outputOptions", {
- get: util.deprecate(
- /**
- * @this {ChunkTemplate}
- * @returns {OutputOptions} output options
- */
- function () {
- return this._outputOptions;
- },
- "ChunkTemplate.outputOptions is deprecated (use Compilation.outputOptions instead)",
- "DEP_WEBPACK_CHUNK_TEMPLATE_OUTPUT_OPTIONS"
- )
-});
-
-module.exports = ChunkTemplate;