Sha256: 8394fff8c486f2b07c5ecf26dc8906c01673556377dbe976b96bfc5eee439ce8

Contents?: true

Size: 934 Bytes

Versions: 10

Compression:

Stored size: 934 Bytes

Contents

/*
	MIT License http://www.opensource.org/licenses/mit-license.php
	Author Tobias Koppers @sokra
*/
"use strict";

class Entrypoint {
	constructor(name) {
		this.name = name;
		this.chunks = [];
	}

	unshiftChunk(chunk) {
		this.chunks.unshift(chunk);
		chunk.entrypoints.push(this);
	}

	insertChunk(chunk, before) {
		const idx = this.chunks.indexOf(before);
		if(idx >= 0) {
			this.chunks.splice(idx, 0, chunk);
		} else {
			throw new Error("before chunk not found");
		}
		chunk.entrypoints.push(this);
	}

	getFiles() {
		const files = [];

		for(let chunkIdx = 0; chunkIdx < this.chunks.length; chunkIdx++) {
			for(let fileIdx = 0; fileIdx < this.chunks[chunkIdx].files.length; fileIdx++) {
				if(files.indexOf(this.chunks[chunkIdx].files[fileIdx]) === -1) {
					files.push(this.chunks[chunkIdx].files[fileIdx]);
				}
			}
		}

		return files;
	}
}

module.exports = Entrypoint;

Version data entries

10 entries across 6 versions & 3 rubygems

Version Path
ilog-0.4.1 node_modules/webpack/lib/Entrypoint.js
ilog-0.4.0 node_modules/webpack/lib/Entrypoint.js
ilog-0.3.3 node_modules/webpack/lib/Entrypoint.js
optimacms-0.4.3 spec/dummy/node_modules/@rails/webpacker/node_modules/webpack/node_modules/webpack/lib/Entrypoint.js
optimacms-0.4.3 spec/dummy/node_modules/@rails/webpacker/node_modules/webpack/lib/Entrypoint.js
optimacms-0.4.3 spec/dummy/node_modules/webpack/lib/Entrypoint.js
optimacms-0.4.2 spec/dummy/node_modules/@rails/webpacker/node_modules/webpack/lib/Entrypoint.js
optimacms-0.4.2 spec/dummy/node_modules/webpack/lib/Entrypoint.js
optimacms-0.4.2 spec/dummy/node_modules/@rails/webpacker/node_modules/webpack/node_modules/webpack/lib/Entrypoint.js
cortex-0.1.3 spec/dummy/node_modules/webpack/lib/Entrypoint.js