Last change
on this file since ceaed42 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
1.2 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 |
|
---|
8 | const ArrayPushCallbackChunkFormatPlugin = require("../javascript/ArrayPushCallbackChunkFormatPlugin");
|
---|
9 | const EnableChunkLoadingPlugin = require("../javascript/EnableChunkLoadingPlugin");
|
---|
10 | const JsonpChunkLoadingRuntimeModule = require("./JsonpChunkLoadingRuntimeModule");
|
---|
11 |
|
---|
12 | /** @typedef {import("../Chunk")} Chunk */
|
---|
13 | /** @typedef {import("../Compilation")} Compilation */
|
---|
14 | /** @typedef {import("../Compiler")} Compiler */
|
---|
15 |
|
---|
16 | class JsonpTemplatePlugin {
|
---|
17 | /**
|
---|
18 | * @deprecated use JsonpChunkLoadingRuntimeModule.getCompilationHooks instead
|
---|
19 | * @param {Compilation} compilation the compilation
|
---|
20 | * @returns {JsonpChunkLoadingRuntimeModule.JsonpCompilationPluginHooks} hooks
|
---|
21 | */
|
---|
22 | static getCompilationHooks(compilation) {
|
---|
23 | return JsonpChunkLoadingRuntimeModule.getCompilationHooks(compilation);
|
---|
24 | }
|
---|
25 |
|
---|
26 | /**
|
---|
27 | * Apply the plugin
|
---|
28 | * @param {Compiler} compiler the compiler instance
|
---|
29 | * @returns {void}
|
---|
30 | */
|
---|
31 | apply(compiler) {
|
---|
32 | compiler.options.output.chunkLoading = "jsonp";
|
---|
33 | new ArrayPushCallbackChunkFormatPlugin().apply(compiler);
|
---|
34 | new EnableChunkLoadingPlugin("jsonp").apply(compiler);
|
---|
35 | }
|
---|
36 | }
|
---|
37 |
|
---|
38 | module.exports = JsonpTemplatePlugin;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.