Last change
on this file since 6a80231 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Rev | Line | |
---|
[6a3a178] | 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 makeSerializable = require("../util/makeSerializable");
|
---|
| 9 | const ContextDependency = require("./ContextDependency");
|
---|
| 10 | const ContextDependencyTemplateAsRequireCall = require("./ContextDependencyTemplateAsRequireCall");
|
---|
| 11 |
|
---|
| 12 | class CommonJsRequireContextDependency extends ContextDependency {
|
---|
| 13 | constructor(options, range, valueRange) {
|
---|
| 14 | super(options);
|
---|
| 15 |
|
---|
| 16 | this.range = range;
|
---|
| 17 | this.valueRange = valueRange;
|
---|
| 18 | }
|
---|
| 19 |
|
---|
| 20 | get type() {
|
---|
| 21 | return "cjs require context";
|
---|
| 22 | }
|
---|
| 23 |
|
---|
| 24 | serialize(context) {
|
---|
| 25 | const { write } = context;
|
---|
| 26 |
|
---|
| 27 | write(this.range);
|
---|
| 28 | write(this.valueRange);
|
---|
| 29 |
|
---|
| 30 | super.serialize(context);
|
---|
| 31 | }
|
---|
| 32 |
|
---|
| 33 | deserialize(context) {
|
---|
| 34 | const { read } = context;
|
---|
| 35 |
|
---|
| 36 | this.range = read();
|
---|
| 37 | this.valueRange = read();
|
---|
| 38 |
|
---|
| 39 | super.deserialize(context);
|
---|
| 40 | }
|
---|
| 41 | }
|
---|
| 42 |
|
---|
| 43 | makeSerializable(
|
---|
| 44 | CommonJsRequireContextDependency,
|
---|
| 45 | "webpack/lib/dependencies/CommonJsRequireContextDependency"
|
---|
| 46 | );
|
---|
| 47 |
|
---|
| 48 | CommonJsRequireContextDependency.Template =
|
---|
| 49 | ContextDependencyTemplateAsRequireCall;
|
---|
| 50 |
|
---|
| 51 | module.exports = CommonJsRequireContextDependency;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.