source: frontend/node_modules/webpack/lib/web/JsonpTemplatePlugin.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 1.3 KB
Line 
1/*
2 MIT License http://www.opensource.org/licenses/mit-license.php
3 Author Tobias Koppers @sokra
4*/
5
6"use strict";
7
8const ArrayPushCallbackChunkFormatPlugin = require("../javascript/ArrayPushCallbackChunkFormatPlugin");
9const EnableChunkLoadingPlugin = require("../javascript/EnableChunkLoadingPlugin");
10const JsonpChunkLoadingRuntimeModule = require("./JsonpChunkLoadingRuntimeModule");
11
12/** @typedef {import("../Compilation")} Compilation */
13/** @typedef {import("../Compiler")} Compiler */
14
15// TODO webpack 6 remove this class
16class JsonpTemplatePlugin {
17 /**
18 * Returns hooks.
19 * @deprecated use JsonpChunkLoadingRuntimeModule.getCompilationHooks instead
20 * @param {Compilation} compilation the compilation
21 * @returns {JsonpChunkLoadingRuntimeModule.JsonpCompilationPluginHooks} hooks
22 */
23 static getCompilationHooks(compilation) {
24 return JsonpChunkLoadingRuntimeModule.getCompilationHooks(compilation);
25 }
26
27 /**
28 * Applies the plugin by registering its hooks on the compiler.
29 * @param {Compiler} compiler the compiler instance
30 * @returns {void}
31 */
32 apply(compiler) {
33 compiler.options.output.chunkLoading = "jsonp";
34 new ArrayPushCallbackChunkFormatPlugin().apply(compiler);
35 new EnableChunkLoadingPlugin("jsonp").apply(compiler);
36 }
37}
38
39module.exports = JsonpTemplatePlugin;
Note: See TracBrowser for help on using the repository browser.