source: trip-planner-front/node_modules/webpack/lib/dependencies/StaticExportsDependency.js@ 8d391a1

Last change on this file since 8d391a1 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.6 KB
Line 
1/*
2 MIT License http://www.opensource.org/licenses/mit-license.php
3 Author Tobias Koppers @sokra
4*/
5
6"use strict";
7
8const makeSerializable = require("../util/makeSerializable");
9const NullDependency = require("./NullDependency");
10
11/** @typedef {import("../ChunkGraph")} ChunkGraph */
12/** @typedef {import("../Dependency").ExportSpec} ExportSpec */
13/** @typedef {import("../Dependency").ExportsSpec} ExportsSpec */
14/** @typedef {import("../Dependency").UpdateHashContext} UpdateHashContext */
15/** @typedef {import("../ModuleGraph")} ModuleGraph */
16/** @typedef {import("../util/Hash")} Hash */
17
18class StaticExportsDependency extends NullDependency {
19 /**
20 * @param {string[] | true} exports export names
21 * @param {boolean} canMangle true, if mangling exports names is allowed
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 * Returns the exported names
35 * @param {ModuleGraph} moduleGraph module graph
36 * @returns {ExportsSpec | undefined} export names
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
61makeSerializable(
62 StaticExportsDependency,
63 "webpack/lib/dependencies/StaticExportsDependency"
64);
65
66module.exports = StaticExportsDependency;
Note: See TracBrowser for help on using the repository browser.