-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnamed_source_file.js
More file actions
36 lines (32 loc) · 1.49 KB
/
named_source_file.js
File metadata and controls
36 lines (32 loc) · 1.49 KB
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
28
29
30
31
32
33
34
35
36
// eslint-disable-next-line no-unused-vars
import AbstractExternalPackage from "../abstract_external_package"
// eslint-disable-next-line no-unused-vars
import CommonInfo from "../common_info"
import UnnamedSourceFile from "./unnamed_source_file"
/**
* Represents a source file that will be bundled.
*/
export default class NamedSourceFile extends UnnamedSourceFile {
/**
* Creates a representation of source file.
* @param {CommonInfo} commonInfo Common information for sources.
* @param {string} name Name of the bundle.
* @param {string|RelativePathPair} file The relative path of the source and bundled file which
* are both relative to the `inputDirectory` and
* `outputDirectory` of `CommonInfoBuilder` class. It can
* be also a relative path pair which may have two
* different directories.
* @param {any} plugins Plugins that will be used to bundle the source file.
* @param {AbstractExternalPackage[]} externals Optional. Array of external packages that will
* not be included in the bundle.
*/
constructor(commonInfo, name, file, plugins, externals = []) {
super(commonInfo, file, plugins, externals)
this._name = name
}
_convertIntoBasicConfiguration() {
const configuration = super._convertIntoBasicConfiguration()
configuration.output.name = this._name
return configuration
}
}