1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | "use strict";
|
7 |
|
8 | const makeSerializable = require("../util/makeSerializable");
|
9 | const NullDependency = require("./NullDependency");
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | class StaticExportsDependency extends NullDependency {
|
19 | |
20 |
|
21 |
|
22 |
|
23 | constructor(exports, canMangle) {
|
24 | super();
|
25 | this.exports = exports;
|
26 | this.canMangle = canMangle;
|
27 | }
|
28 |
|
29 | get type() {
|
30 | return "static exports";
|
31 | }
|
32 |
|
33 | |
34 |
|
35 |
|
36 |
|
37 |
|
38 | getExports(moduleGraph) {
|
39 | return {
|
40 | exports: this.exports,
|
41 | canMangle: this.canMangle,
|
42 | dependencies: undefined
|
43 | };
|
44 | }
|
45 |
|
46 | serialize(context) {
|
47 | const { write } = context;
|
48 | write(this.exports);
|
49 | write(this.canMangle);
|
50 | super.serialize(context);
|
51 | }
|
52 |
|
53 | deserialize(context) {
|
54 | const { read } = context;
|
55 | this.exports = read();
|
56 | this.canMangle = read();
|
57 | super.deserialize(context);
|
58 | }
|
59 | }
|
60 |
|
61 | makeSerializable(
|
62 | StaticExportsDependency,
|
63 | "webpack/lib/dependencies/StaticExportsDependency"
|
64 | );
|
65 |
|
66 | module.exports = StaticExportsDependency;
|