UNPKG

st-bundle

Version:

CLI for watching and bundling SpringType projects.

37 lines (36 loc) 941 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); class Package { constructor(props) { this.props = props; this.modules = []; this.userEntries = []; this.externalPackages = []; } setEntry(module) { this.entry = module; } getAllEntries() { const entries = []; if (this.entry) entries.push(this.entry); if (this.userEntries) this.userEntries.forEach(entry => entries.push(entry)); return entries; } getPublicName() { if (!this.isFlat) { return `${this.props.meta.name}@${this.props.meta.version}`; } return this.props.meta.name; } setCache(basics) { this.isCached = true; this.cache = basics; } } exports.Package = Package; function createPackage(props) { return new Package(props); } exports.createPackage = createPackage;