2013-01-31 01:49:25 +08:00
|
|
|
/*
|
|
|
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
|
|
Author Tobias Koppers @sokra
|
|
|
|
*/
|
2018-07-30 23:08:51 +08:00
|
|
|
|
2017-01-13 11:53:12 +08:00
|
|
|
"use strict";
|
|
|
|
|
2020-08-25 02:26:31 +08:00
|
|
|
const ArrayPushCallbackChunkFormatPlugin = require("../javascript/ArrayPushCallbackChunkFormatPlugin");
|
2020-08-25 19:20:29 +08:00
|
|
|
const JsonpChunkLoadingPlugin = require("./JsonpChunkLoadingPlugin");
|
2018-11-23 16:37:33 +08:00
|
|
|
const JsonpChunkLoadingRuntimeModule = require("./JsonpChunkLoadingRuntimeModule");
|
2017-01-13 11:53:12 +08:00
|
|
|
|
2018-11-23 16:37:33 +08:00
|
|
|
/** @typedef {import("../Chunk")} Chunk */
|
|
|
|
/** @typedef {import("../Compilation")} Compilation */
|
2018-11-09 05:59:19 +08:00
|
|
|
/** @typedef {import("../Compiler")} Compiler */
|
|
|
|
|
2017-01-13 11:53:12 +08:00
|
|
|
class JsonpTemplatePlugin {
|
2018-11-23 16:37:33 +08:00
|
|
|
/**
|
2020-08-25 19:20:29 +08:00
|
|
|
* @deprecated use JsonpChunkLoadingRuntimeModule.getCompilationHooks instead
|
2018-11-23 16:37:33 +08:00
|
|
|
* @param {Compilation} compilation the compilation
|
2020-08-25 19:20:29 +08:00
|
|
|
* @returns {JsonpChunkLoadingRuntimeModule.JsonpCompilationPluginHooks} hooks
|
2018-11-23 16:37:33 +08:00
|
|
|
*/
|
|
|
|
static getCompilationHooks(compilation) {
|
2020-08-25 19:20:29 +08:00
|
|
|
return JsonpChunkLoadingRuntimeModule.getCompilationHooks(compilation);
|
2018-11-23 16:37:33 +08:00
|
|
|
}
|
|
|
|
|
2018-11-09 05:59:19 +08:00
|
|
|
/**
|
2020-04-23 16:48:36 +08:00
|
|
|
* Apply the plugin
|
2018-11-09 05:59:19 +08:00
|
|
|
* @param {Compiler} compiler the compiler instance
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
2017-01-13 11:53:12 +08:00
|
|
|
apply(compiler) {
|
2020-08-25 02:26:31 +08:00
|
|
|
new ArrayPushCallbackChunkFormatPlugin().apply(compiler);
|
2020-08-25 19:20:29 +08:00
|
|
|
new JsonpChunkLoadingPlugin().apply(compiler);
|
2017-01-13 11:53:12 +08:00
|
|
|
}
|
|
|
|
}
|
2013-01-31 01:49:25 +08:00
|
|
|
|
|
|
|
module.exports = JsonpTemplatePlugin;
|