1 |
|
2 |
|
3 |
|
4 |
|
5 | "use strict";
|
6 |
|
7 | const { RawSource } = require("webpack-sources");
|
8 | const Module = require("./Module");
|
9 |
|
10 |
|
11 |
|
12 | class DllModule extends Module {
|
13 | constructor(context, dependencies, name, type) {
|
14 | super("javascript/dynamic", context);
|
15 |
|
16 |
|
17 | this.dependencies = dependencies;
|
18 | this.name = name;
|
19 | this.type = type;
|
20 | }
|
21 |
|
22 | identifier() {
|
23 | return `dll ${this.name}`;
|
24 | }
|
25 |
|
26 | readableIdentifier() {
|
27 | return `dll ${this.name}`;
|
28 | }
|
29 |
|
30 | build(options, compilation, resolver, fs, callback) {
|
31 | this.built = true;
|
32 | this.buildMeta = {};
|
33 | this.buildInfo = {};
|
34 | return callback();
|
35 | }
|
36 |
|
37 | source() {
|
38 | return new RawSource("module.exports = __webpack_require__;");
|
39 | }
|
40 |
|
41 | needRebuild() {
|
42 | return false;
|
43 | }
|
44 |
|
45 | size() {
|
46 | return 12;
|
47 | }
|
48 |
|
49 | |
50 |
|
51 |
|
52 |
|
53 | updateHash(hash) {
|
54 | hash.update("dll module");
|
55 | hash.update(this.name || "");
|
56 | super.updateHash(hash);
|
57 | }
|
58 | }
|
59 |
|
60 | module.exports = DllModule;
|