Last change
on this file since 59329aa was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
743 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 |
|
---|
| 10 | class LocalModule {
|
---|
| 11 | constructor(name, idx) {
|
---|
| 12 | this.name = name;
|
---|
| 13 | this.idx = idx;
|
---|
| 14 | this.used = false;
|
---|
| 15 | }
|
---|
| 16 |
|
---|
| 17 | flagUsed() {
|
---|
| 18 | this.used = true;
|
---|
| 19 | }
|
---|
| 20 |
|
---|
| 21 | variableName() {
|
---|
| 22 | return "__WEBPACK_LOCAL_MODULE_" + this.idx + "__";
|
---|
| 23 | }
|
---|
| 24 |
|
---|
| 25 | serialize(context) {
|
---|
| 26 | const { write } = context;
|
---|
| 27 |
|
---|
| 28 | write(this.name);
|
---|
| 29 | write(this.idx);
|
---|
| 30 | write(this.used);
|
---|
| 31 | }
|
---|
| 32 |
|
---|
| 33 | deserialize(context) {
|
---|
| 34 | const { read } = context;
|
---|
| 35 |
|
---|
| 36 | this.name = read();
|
---|
| 37 | this.idx = read();
|
---|
| 38 | this.used = read();
|
---|
| 39 | }
|
---|
| 40 | }
|
---|
| 41 |
|
---|
| 42 | makeSerializable(LocalModule, "webpack/lib/dependencies/LocalModule");
|
---|
| 43 |
|
---|
| 44 | module.exports = LocalModule;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.