main
Last change
on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
894 bytes
|
Line | |
---|
1 | /*
|
---|
2 | MIT License http://www.opensource.org/licenses/mit-license.php
|
---|
3 | Author Ivan Kopeykin @vankop
|
---|
4 | */
|
---|
5 |
|
---|
6 | "use strict";
|
---|
7 |
|
---|
8 | const RuntimeGlobals = require("../RuntimeGlobals");
|
---|
9 | const RuntimeModule = require("../RuntimeModule");
|
---|
10 |
|
---|
11 | /** @typedef {import("../../declarations/WebpackOptions").EntryDescriptionNormalized} EntryDescriptionNormalized */
|
---|
12 | /** @typedef {import("../Chunk")} Chunk */
|
---|
13 |
|
---|
14 | class BaseUriRuntimeModule extends RuntimeModule {
|
---|
15 | constructor() {
|
---|
16 | super("base uri", RuntimeModule.STAGE_ATTACH);
|
---|
17 | }
|
---|
18 |
|
---|
19 | /**
|
---|
20 | * @returns {string | null} runtime code
|
---|
21 | */
|
---|
22 | generate() {
|
---|
23 | const chunk = /** @type {Chunk} */ (this.chunk);
|
---|
24 | const options =
|
---|
25 | /** @type {EntryDescriptionNormalized} */
|
---|
26 | (chunk.getEntryOptions());
|
---|
27 | return `${RuntimeGlobals.baseURI} = ${
|
---|
28 | options.baseUri === undefined
|
---|
29 | ? "undefined"
|
---|
30 | : JSON.stringify(options.baseUri)
|
---|
31 | };`;
|
---|
32 | }
|
---|
33 | }
|
---|
34 |
|
---|
35 | module.exports = BaseUriRuntimeModule;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.