CssDependency.js
2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function _react() {
const data = _interopRequireDefault(require("react"));
_react = function _react() {
return data;
};
return data;
}
function _webpack() {
const data = _interopRequireDefault(require("@umijs/deps/compiled/webpack"));
_webpack = function _webpack() {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
class CssDependency extends _webpack().default.Dependency {
constructor({
identifier,
content,
media,
sourceMap
}, context, identifierIndex) {
super();
this.identifier = identifier;
this.identifierIndex = identifierIndex;
this.content = content;
this.media = media;
this.sourceMap = sourceMap;
this.context = context;
}
getResourceIdentifier() {
return `css-module-${this.identifier}-${this.identifierIndex}`;
} // eslint-disable-next-line class-methods-use-this
getModuleEvaluationSideEffectsState() {
return _webpack().default.ModuleGraphConnection.TRANSITIVE_ONLY;
}
serialize(context) {
const write = context.write;
write(this.identifier);
write(this.content);
write(this.media);
write(this.sourceMap);
write(this.context);
write(this.identifierIndex);
super.serialize(context);
}
deserialize(context) {
super.deserialize(context);
}
}
if (_webpack().default.util && _webpack().default.util.serialization) {
_webpack().default.util.serialization.register(CssDependency, 'mini-css-extract-plugin/dist/CssDependency', null, {
serialize(instance, context) {
instance.serialize(context);
},
deserialize(context) {
const read = context.read;
const dep = new CssDependency({
identifier: read(),
content: read(),
media: read(),
sourceMap: read()
}, read(), read());
dep.deserialize(context);
return dep;
}
});
}
var _default = CssDependency;
exports.default = _default;