1 |
|
2 |
|
3 |
|
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 |
|
13 |
|
14 |
|
15 |
|
16 | class JsonpTemplatePlugin {
|
17 | |
18 |
|
19 |
|
20 |
|
21 |
|
22 | static getCompilationHooks(compilation) {
|
23 | return JsonpChunkLoadingRuntimeModule.getCompilationHooks(compilation);
|
24 | }
|
25 |
|
26 | |
27 |
|
28 |
|
29 |
|
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;
|