-
Notifications
You must be signed in to change notification settings - Fork 0
/
imported_external_package.js
27 lines (25 loc) · 1.22 KB
/
imported_external_package.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import AbstractExternalPackage from "../abstract_external_package";
import CommonInfo from "../common_info";
import NamedSourceFile from "../source_file/named_source_file";
/**
* Represents a package linked by importing it.
*/
export default class ImportedExternalPackage extends AbstractExternalPackage {
/**
* Creates a representation of imported external package.
* @param {CommonInfo} commonInfo Common information from common info builder.
* @param {string} externalName The name of the linked package.
* @param {string} globalName The global variable that identifies the linked package.
* @param {string} file The path to the source file which imports the external package.
* @param {any[]} plugins Plugins that will be used to bundle the source file.
* @param {AbstractExternalPackage[]} [externals=[]] Array of external packages that will not be
* included in the bundle.
*/
constructor(commonInfo, externalName, globalName, file, plugins, externals = []) {
super(externalName, globalName);
this._sourceFile = new NamedSourceFile(commonInfo, globalName, file, plugins, externals);
}
toConfigurationArray() {
return this._sourceFile.toConfigurationArray();
}
}