mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 11:35:12 +08:00
# Conflicts: # jsowell-ui/.env.development # jsowell-ui/.env.staging # jsowell-ui/bin/build-sit.bat # jsowell-ui/bin/build.bat # jsowell-ui/src/api/adapayMember/adapayMember.js # jsowell-ui/src/api/pile/merchant.js # jsowell-ui/src/router/index.js # jsowell-ui/src/views/financial/financeDetail.vue # jsowell-ui/src/views/financial/merchant.vue # jsowell-ui/src/views/homeIndex/homeIndex.vue # jsowell-ui/src/views/login.vue # jsowell-ui/src/views/pile/basic/detail.vue # jsowell-ui/src/views/pile/station/components/SiteInfo.vue # jsowell-ui/src/views/pile/station/detail.vue # jsowell-ui/src/views/pile/station/orderReport.vue
65 lines
1.8 KiB
JavaScript
65 lines
1.8 KiB
JavaScript
/*
|
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
Author Tobias Koppers @sokra
|
|
*/
|
|
"use strict";
|
|
|
|
const ChunkGroup = require("./ChunkGroup");
|
|
|
|
/** @typedef {import("./Chunk")} Chunk */
|
|
|
|
/**
|
|
* Entrypoint serves as an encapsulation primitive for chunks that are
|
|
* a part of a single ChunkGroup. They represent all bundles that need to be loaded for a
|
|
* single instance of a page. Multi-page application architectures will typically yield multiple Entrypoint objects
|
|
* inside of the compilation, whereas a Single Page App may only contain one with many lazy-loaded chunks.
|
|
*/
|
|
class Entrypoint extends ChunkGroup {
|
|
/**
|
|
* Creates an instance of Entrypoint.
|
|
* @param {string} name the name of the entrypoint
|
|
*/
|
|
constructor(name) {
|
|
super(name);
|
|
/** @type {Chunk=} */
|
|
this.runtimeChunk = undefined;
|
|
}
|
|
|
|
/**
|
|
* isInitial will always return true for Entrypoint ChunkGroup.
|
|
* @returns {true} returns true as all entrypoints are initial ChunkGroups
|
|
*/
|
|
isInitial() {
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* Sets the runtimeChunk for an entrypoint.
|
|
* @param {Chunk} chunk the chunk being set as the runtime chunk.
|
|
* @returns {void}
|
|
*/
|
|
setRuntimeChunk(chunk) {
|
|
this.runtimeChunk = chunk;
|
|
}
|
|
|
|
/**
|
|
* Fetches the chunk reference containing the webpack bootstrap code
|
|
* @returns {Chunk} returns the runtime chunk or first chunk in `this.chunks`
|
|
*/
|
|
getRuntimeChunk() {
|
|
return this.runtimeChunk || this.chunks[0];
|
|
}
|
|
|
|
/**
|
|
* @param {Chunk} oldChunk chunk to be replaced
|
|
* @param {Chunk} newChunk New chunk that will be replaced with
|
|
* @returns {boolean} returns true if the replacement was successful
|
|
*/
|
|
replaceChunk(oldChunk, newChunk) {
|
|
if (this.runtimeChunk === oldChunk) this.runtimeChunk = newChunk;
|
|
return super.replaceChunk(oldChunk, newChunk);
|
|
}
|
|
}
|
|
|
|
module.exports = Entrypoint;
|