Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102288692
StartupEntrypointRuntimeModule.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Feb 19, 03:53
Size
1 KB
Mime Type
text/x-c++
Expires
Fri, Feb 21, 03:53 (2 d)
Engine
blob
Format
Raw Data
Handle
24324581
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
StartupEntrypointRuntimeModule.js
View Options
/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use strict";
const RuntimeGlobals = require("../RuntimeGlobals");
const RuntimeModule = require("../RuntimeModule");
/** @typedef {import("../MainTemplate")} MainTemplate */
class StartupEntrypointRuntimeModule extends RuntimeModule {
constructor(asyncChunkLoading) {
super("startup entrypoint");
this.asyncChunkLoading = asyncChunkLoading;
}
/**
* @returns {string} runtime code
*/
generate() {
const { compilation } = this;
const { runtimeTemplate } = compilation;
return `${
RuntimeGlobals.startupEntrypoint
} = ${runtimeTemplate.basicFunction(
"chunkIds, moduleId",
this.asyncChunkLoading
? `return Promise.all(chunkIds.map(${
RuntimeGlobals.ensureChunk
}, __webpack_require__)).then(${runtimeTemplate.returningFunction(
"__webpack_require__(moduleId)"
)})`
: [
`chunkIds.map(${RuntimeGlobals.ensureChunk}, __webpack_require__)`,
"return __webpack_require__(moduleId)"
]
)}`;
}
}
module.exports = StartupEntrypointRuntimeModule;
Event Timeline
Log In to Comment