source: trip-planner-front/node_modules/webpack/lib/dependencies/AMDRuntimeModules.js@ 6a3a178

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: 1.0 KB
Line 
1/*
2 MIT License http://www.opensource.org/licenses/mit-license.php
3*/
4
5"use strict";
6
7const RuntimeGlobals = require("../RuntimeGlobals");
8const RuntimeModule = require("../RuntimeModule");
9const Template = require("../Template");
10
11class AMDDefineRuntimeModule extends RuntimeModule {
12 constructor() {
13 super("amd define");
14 }
15
16 /**
17 * @returns {string} runtime code
18 */
19 generate() {
20 return Template.asString([
21 `${RuntimeGlobals.amdDefine} = function () {`,
22 Template.indent("throw new Error('define cannot be used indirect');"),
23 "};"
24 ]);
25 }
26}
27
28class AMDOptionsRuntimeModule extends RuntimeModule {
29 /**
30 * @param {Record<string, boolean | number | string>} options the AMD options
31 */
32 constructor(options) {
33 super("amd options");
34 this.options = options;
35 }
36
37 /**
38 * @returns {string} runtime code
39 */
40 generate() {
41 return Template.asString([
42 `${RuntimeGlobals.amdOptions} = ${JSON.stringify(this.options)};`
43 ]);
44 }
45}
46
47exports.AMDDefineRuntimeModule = AMDDefineRuntimeModule;
48exports.AMDOptionsRuntimeModule = AMDOptionsRuntimeModule;
Note: See TracBrowser for help on using the repository browser.