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