2016-07-13 17:03:14 +08:00
|
|
|
/*
|
|
|
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
|
|
Author Tobias Koppers @sokra
|
|
|
|
*/
|
2016-12-29 14:58:26 +08:00
|
|
|
"use strict";
|
2016-07-13 17:03:14 +08:00
|
|
|
|
2018-01-20 00:06:59 +08:00
|
|
|
const ChunkGroup = require("./ChunkGroup");
|
|
|
|
|
|
|
|
class Entrypoint extends ChunkGroup {
|
2016-12-29 14:58:26 +08:00
|
|
|
constructor(name) {
|
2018-01-20 00:06:59 +08:00
|
|
|
super(name);
|
2018-01-11 00:08:56 +08:00
|
|
|
this.runtimeChunk = undefined;
|
2016-12-29 14:58:26 +08:00
|
|
|
}
|
|
|
|
|
2018-01-20 00:06:59 +08:00
|
|
|
isInitial() {
|
|
|
|
return true;
|
2018-01-09 16:40:30 +08:00
|
|
|
}
|
|
|
|
|
2016-12-29 14:58:26 +08:00
|
|
|
getFiles() {
|
2017-11-06 23:41:26 +08:00
|
|
|
const files = new Set();
|
2016-12-01 12:37:14 +08:00
|
|
|
|
2018-02-25 09:00:20 +08:00
|
|
|
for (const chunk of this.chunks) {
|
|
|
|
for (const file of chunk.files) {
|
2018-02-08 06:11:21 +08:00
|
|
|
files.add(file);
|
2016-11-29 08:38:17 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-06 23:41:26 +08:00
|
|
|
return Array.from(files);
|
2016-12-29 14:58:26 +08:00
|
|
|
}
|
2017-04-23 00:59:15 +08:00
|
|
|
|
2018-01-11 00:08:56 +08:00
|
|
|
setRuntimeChunk(chunk) {
|
|
|
|
this.runtimeChunk = chunk;
|
|
|
|
}
|
|
|
|
|
2017-04-23 00:59:15 +08:00
|
|
|
getRuntimeChunk() {
|
2018-01-11 00:08:56 +08:00
|
|
|
return this.runtimeChunk || this.chunks[0];
|
2017-04-23 00:59:15 +08:00
|
|
|
}
|
2016-11-29 08:38:17 +08:00
|
|
|
}
|
2016-12-29 14:58:26 +08:00
|
|
|
|
|
|
|
module.exports = Entrypoint;
|