weboptimizer 2.0.1491 → 2.0.1492
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser.js +7 -5
- package/configurator.js +12 -12
- package/declarations.d.ts +3 -7
- package/ejsLoader.d.ts +1 -1
- package/ejsLoader.js +24 -23
- package/eslint.config.d.ts +2 -2
- package/eslint.config.mjs +39 -18
- package/helper.d.ts +242 -261
- package/helper.js +830 -894
- package/index.js +15 -13
- package/jestEnvironmentBrowser.js +3 -1
- package/jestSetup.js +2 -0
- package/package.json +23 -42
- package/plugins/HTMLTransformation.js +4 -3
- package/plugins/InPlaceAssetsIntoHTML.js +1 -1
- package/tsconfig.json +3 -1
- package/type.d.ts +11 -10
- package/webpackConfigurator.js +17 -15
package/helper.d.ts
CHANGED
|
@@ -2,265 +2,246 @@ import { Encoding, Mapping } from 'clientnode';
|
|
|
2
2
|
import { BuildConfiguration, Extensions, GivenInjection, GivenInjectionConfiguration, NormalizedGivenInjection, PathConfiguration, PackageDescriptor, Replacements, ResolvedBuildConfiguration, SpecificExtensions } from './type';
|
|
3
3
|
export declare const KNOWN_FILE_EXTENSIONS: Array<string>;
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Determines whether given file path is within given list of file locations.
|
|
6
|
+
* @param filePath - Path to file to check.
|
|
7
|
+
* @param locationsToCheck - Locations to take into account.
|
|
8
|
+
* @returns Value "true" if given file path is within one of given locations or
|
|
9
|
+
* "false" otherwise.
|
|
6
10
|
*/
|
|
7
|
-
export declare
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
* corresponding replacements.
|
|
245
|
-
* @returns The replacement applied given module id.
|
|
246
|
-
*/
|
|
247
|
-
static applyModuleReplacements(this: void, moduleID: false | string, replacements: Replacements): false | string;
|
|
248
|
-
/**
|
|
249
|
-
* Determines the nearest package configuration file from given file path.
|
|
250
|
-
* @param start - Reference location to search from.
|
|
251
|
-
* @param fileName - Package configuration file name.
|
|
252
|
-
* @returns Determined file path.
|
|
253
|
-
*/
|
|
254
|
-
static findPackageDescriptorFilePath(this: void, start: Array<string> | string, fileName?: string): null | string;
|
|
255
|
-
/**
|
|
256
|
-
* Determines the nearest package configuration from given module file
|
|
257
|
-
* path.
|
|
258
|
-
* @param modulePath - Module path to take as reference location (leaf in
|
|
259
|
-
* tree).
|
|
260
|
-
* @param fileName - Package configuration file name.
|
|
261
|
-
* @returns A object containing found parsed configuration an their
|
|
262
|
-
* corresponding file path.
|
|
263
|
-
*/
|
|
264
|
-
static getClosestPackageDescriptor(this: void, modulePath: string, fileName?: string): null | PackageDescriptor;
|
|
265
|
-
}
|
|
266
|
-
export default Helper;
|
|
11
|
+
export declare const isFilePathInLocation: (filePath: string, locationsToCheck: Array<string>) => boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Strips loader informations form given module request including loader prefix
|
|
14
|
+
* and query parameter.
|
|
15
|
+
* @param moduleID - Module request to strip.
|
|
16
|
+
* @returns Given module id stripped.
|
|
17
|
+
*/
|
|
18
|
+
export declare const stripLoader: (moduleID: string) => string;
|
|
19
|
+
/**
|
|
20
|
+
* Converts given list of path to a normalized list with unique values.
|
|
21
|
+
* @param paths - File paths.
|
|
22
|
+
* @returns The given file path list with normalized unique values.
|
|
23
|
+
*/
|
|
24
|
+
export declare const normalizePaths: (paths: Array<string>) => Array<string>;
|
|
25
|
+
/**
|
|
26
|
+
* Applies file path/name placeholder replacements with given bundle associated
|
|
27
|
+
* informations.
|
|
28
|
+
* @param template - File path to process placeholder in.
|
|
29
|
+
* @param scope - Scope to use for processing.
|
|
30
|
+
* @returns Processed file path.
|
|
31
|
+
*/
|
|
32
|
+
export declare const renderFilePathTemplate: (template: string, scope?: Mapping<number | string>) => string;
|
|
33
|
+
/**
|
|
34
|
+
* Converts given request to a resolved request with given context embedded.
|
|
35
|
+
* @param request - Request to determine.
|
|
36
|
+
* @param context - Context of given request to resolve relative to.
|
|
37
|
+
* @param referencePath - Path to resolve local modules relative to.
|
|
38
|
+
* @param aliases - Mapping of aliases to take into account.
|
|
39
|
+
* @param moduleReplacements - Mapping of replacements to take into account.
|
|
40
|
+
* @param relativeModuleLocations - List of relative directory paths to search
|
|
41
|
+
* for modules in.
|
|
42
|
+
* @returns A new resolved request.
|
|
43
|
+
*/
|
|
44
|
+
export declare const applyContext: (request: string, context?: string, referencePath?: string, aliases?: Mapping, moduleReplacements?: Replacements, relativeModuleLocations?: Array<string>) => false | string;
|
|
45
|
+
/**
|
|
46
|
+
* Check if given request points to an external dependency not maintained by
|
|
47
|
+
* current package context.
|
|
48
|
+
* @param request - Request to determine.
|
|
49
|
+
* @param context - Context of current project.
|
|
50
|
+
* @param requestContext - Context of given request to resolve relative to.
|
|
51
|
+
* @param normalizedGivenInjection - Mapping of chunk names to modules which
|
|
52
|
+
* should be injected.
|
|
53
|
+
* @param relativeExternalModuleLocations - Array of paths where external
|
|
54
|
+
* modules take place.
|
|
55
|
+
* @param aliases - Mapping of aliases to take into account.
|
|
56
|
+
* @param moduleReplacements - Mapping of replacements to take into account.
|
|
57
|
+
* @param extensions - List of file and module extensions to take into account.
|
|
58
|
+
* @param referencePath - Path to resolve local modules relative to.
|
|
59
|
+
* @param pathsToIgnore - Paths which marks location to ignore.
|
|
60
|
+
* @param relativeModuleLocations - List of relative file path to search for
|
|
61
|
+
* modules in.
|
|
62
|
+
* @param packageEntryFileNames - List of package entry file names to search
|
|
63
|
+
* for. The magic name "__package__" will search for an appreciate entry in a
|
|
64
|
+
* "package.json" file.
|
|
65
|
+
* @param packageMainPropertyNames - List of package file main property names
|
|
66
|
+
* to search for package representing entry module definitions.
|
|
67
|
+
* @param packageAliasPropertyNames - List of package file alias property names
|
|
68
|
+
* to search for package specific module aliases.
|
|
69
|
+
* @param includePattern - Array of regular expressions to explicitly mark as
|
|
70
|
+
* external dependency.
|
|
71
|
+
* @param excludePattern - Array of regular expressions to explicitly mark as
|
|
72
|
+
* internal dependency.
|
|
73
|
+
* @param inPlaceNormalLibrary - Indicates whether normal libraries should be
|
|
74
|
+
* external or not.
|
|
75
|
+
* @param inPlaceDynamicLibrary - Indicates whether requests with integrated
|
|
76
|
+
* loader configurations should be marked as external or not.
|
|
77
|
+
* @param encoding - Encoding for file names to use during file traversing.
|
|
78
|
+
* @returns A new resolved request indicating whether given request is an
|
|
79
|
+
* external one.
|
|
80
|
+
*/
|
|
81
|
+
export declare const determineExternalRequest: (request: string, context?: string, requestContext?: string, normalizedGivenInjection?: NormalizedGivenInjection, relativeExternalModuleLocations?: Array<string>, aliases?: Mapping, moduleReplacements?: Replacements, extensions?: Extensions, referencePath?: string, pathsToIgnore?: Array<string>, relativeModuleLocations?: Array<string>, packageEntryFileNames?: Array<string>, packageMainPropertyNames?: Array<string>, packageAliasPropertyNames?: Array<string>, includePattern?: Array<string | RegExp>, excludePattern?: Array<string | RegExp>, inPlaceNormalLibrary?: boolean, inPlaceDynamicLibrary?: boolean, encoding?: Encoding) => null | string;
|
|
82
|
+
/**
|
|
83
|
+
* Determines asset type of given file.
|
|
84
|
+
* @param filePath - Path to file to analyse.
|
|
85
|
+
* @param buildConfiguration - Meta informations for available asset types.
|
|
86
|
+
* @param paths - List of paths to search if given path doesn't reference a
|
|
87
|
+
* file directly.
|
|
88
|
+
* @returns Determined file type or "null" of given file couldn't be
|
|
89
|
+
* determined.
|
|
90
|
+
*/
|
|
91
|
+
export declare const determineAssetType: (filePath: string, buildConfiguration: BuildConfiguration, paths: PathConfiguration) => null | string;
|
|
92
|
+
/**
|
|
93
|
+
* Adds a property with a stored array of all matching file paths, which
|
|
94
|
+
* matches each build configuration in given entry path and converts given
|
|
95
|
+
* build configuration into a sorted array were javaScript files takes
|
|
96
|
+
* precedence.
|
|
97
|
+
* @param configuration - Given build configurations.
|
|
98
|
+
* @param entryPath - Path to analyse nested structure.
|
|
99
|
+
* @param pathsToIgnore - Paths which marks location to ignore.
|
|
100
|
+
* @param mainFileBasenames - File basenames to sort into the front.
|
|
101
|
+
* @returns Converted build configuration.
|
|
102
|
+
*/
|
|
103
|
+
export declare const resolveBuildConfigurationFilePaths: (configuration: BuildConfiguration, entryPath?: string, pathsToIgnore?: Array<string>, mainFileBasenames?: Array<string>) => ResolvedBuildConfiguration;
|
|
104
|
+
/**
|
|
105
|
+
* Determines all file and directory paths related to given internal modules as
|
|
106
|
+
* array.
|
|
107
|
+
* @param givenInjection - List of module ids or module file paths.
|
|
108
|
+
* @param aliases - Mapping of aliases to take into account.
|
|
109
|
+
* @param moduleReplacements - Mapping of module replacements to take into
|
|
110
|
+
* account.
|
|
111
|
+
* @param extensions - List of file and module extensions to take into account.
|
|
112
|
+
* @param context - File path to resolve relative to.
|
|
113
|
+
* @param referencePath - Path to search for local modules.
|
|
114
|
+
* @param pathsToIgnore - Paths which marks location to ignore.
|
|
115
|
+
* @param relativeModuleLocations - List of relative file path to search for
|
|
116
|
+
* modules in.
|
|
117
|
+
* @param packageEntryFileNames - List of package entry file names to search
|
|
118
|
+
* for. The magic name "__package__" will search for an appreciate entry in a
|
|
119
|
+
* "package.json" file.
|
|
120
|
+
* @param packageMainPropertyNames - List of package file main property names
|
|
121
|
+
* to search for package representing entry module definitions.
|
|
122
|
+
* @param packageAliasPropertyNames - List of package file alias property names
|
|
123
|
+
* to search for package specific module aliases.
|
|
124
|
+
* @param encoding - File name encoding to use during file traversing.
|
|
125
|
+
* @returns Object with a file path and directory path key mapping to
|
|
126
|
+
* corresponding list of paths.
|
|
127
|
+
*/
|
|
128
|
+
export declare const determineModuleLocations: (givenInjection: GivenInjection, aliases?: Mapping, moduleReplacements?: Replacements, extensions?: SpecificExtensions, context?: string, referencePath?: string, pathsToIgnore?: Array<string>, relativeModuleLocations?: Array<string>, packageEntryFileNames?: Array<string>, packageMainPropertyNames?: Array<string>, packageAliasPropertyNames?: Array<string>, encoding?: Encoding) => {
|
|
129
|
+
directoryPaths: Array<string>;
|
|
130
|
+
filePaths: Array<string>;
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Determines a list of concrete file paths for given module id pointing to a
|
|
134
|
+
* folder which isn't a package.
|
|
135
|
+
* @param normalizedGivenInjection - Injection data structure of modules with
|
|
136
|
+
* folder references to resolve.
|
|
137
|
+
* @param aliases - Mapping of aliases to take into account.
|
|
138
|
+
* @param moduleReplacements - Mapping of replacements to take into account.
|
|
139
|
+
* @param context - File path to determine relative to.
|
|
140
|
+
* @param referencePath - Path to resolve local modules relative to.
|
|
141
|
+
* @param pathsToIgnore - Paths which marks location to ignore.
|
|
142
|
+
* @returns Given injections with resolved folder pointing modules.
|
|
143
|
+
*/
|
|
144
|
+
export declare const resolveModulesInFolders: (normalizedGivenInjection: NormalizedGivenInjection, aliases?: Mapping, moduleReplacements?: Replacements, context?: string, referencePath?: string, pathsToIgnore?: Array<string>) => NormalizedGivenInjection;
|
|
145
|
+
/**
|
|
146
|
+
* Every injection definition type can be represented as plain object (mapping
|
|
147
|
+
* from chunk name to array of module ids). This method converts each
|
|
148
|
+
* representation into the normalized plain object notation.
|
|
149
|
+
* @param givenInjection - Given entry injection to normalize.
|
|
150
|
+
* @returns Normalized representation of given entry injection.
|
|
151
|
+
*/
|
|
152
|
+
export declare const normalizeGivenInjection: (givenInjection: GivenInjection) => NormalizedGivenInjection;
|
|
153
|
+
/**
|
|
154
|
+
* Determines all concrete file paths for given injection which are marked with
|
|
155
|
+
* the "__auto__" indicator.
|
|
156
|
+
* @param givenInjection - Given entry and external injection to take into
|
|
157
|
+
* account.
|
|
158
|
+
* @param buildConfigurations - Resolved build configuration.
|
|
159
|
+
* @param aliases - Mapping of aliases to take into account.
|
|
160
|
+
* @param moduleReplacements - Mapping of replacements to take into account.
|
|
161
|
+
* @param extensions - List of file and module extensions to take into account.
|
|
162
|
+
* @param context - File path to use as starting point.
|
|
163
|
+
* @param referencePath - Reference path from where local files should be
|
|
164
|
+
* resolved.
|
|
165
|
+
* @param pathsToIgnore - Paths which marks location to ignore.
|
|
166
|
+
* @returns Given injection with resolved marked indicators.
|
|
167
|
+
*/
|
|
168
|
+
export declare const resolveAutoInjection: <T extends GivenInjectionConfiguration>(givenInjection: T, buildConfigurations: ResolvedBuildConfiguration, aliases?: Mapping, moduleReplacements?: Replacements, extensions?: Extensions, context?: string, referencePath?: string, pathsToIgnore?: Array<string>) => T;
|
|
169
|
+
/**
|
|
170
|
+
* Determines all module file paths.
|
|
171
|
+
* @param buildConfigurations - Resolved build configuration.
|
|
172
|
+
* @param moduleFilePathsToExclude - A list of modules file paths to exclude
|
|
173
|
+
* (specified by path or id).
|
|
174
|
+
* @param moduleFilePathPatternToExclude - A list of modules file paths pattern
|
|
175
|
+
* to exclude (specified by path or id).
|
|
176
|
+
* @param context - File path to use as starting point.
|
|
177
|
+
* @returns All determined module file paths.
|
|
178
|
+
*/
|
|
179
|
+
export declare const getAutoInjection: (buildConfigurations: ResolvedBuildConfiguration, moduleFilePathsToExclude: Array<string>, moduleFilePathPatternToExclude: Array<RegExp | string>, context: string) => Mapping;
|
|
180
|
+
/**
|
|
181
|
+
* Determines a resolved module file path in given package path.
|
|
182
|
+
* @param packagePath - Path to package to resolve in.
|
|
183
|
+
* @param packageMainPropertyNames - List of package file main property names
|
|
184
|
+
* to search for package representing entry module definitions.
|
|
185
|
+
* @param packageAliasPropertyNames - List of package file alias property names
|
|
186
|
+
* to search for package specific module aliases.
|
|
187
|
+
* @param encoding - Encoding to use for file names during file traversing.
|
|
188
|
+
* @returns Path if found and / or additional package aliases to consider.
|
|
189
|
+
*/
|
|
190
|
+
export declare const determineModuleFilePathInPackage: (packagePath: string, packageMainPropertyNames?: Array<string>, packageAliasPropertyNames?: Array<string>, encoding?: Encoding) => {
|
|
191
|
+
fileName: null | string;
|
|
192
|
+
packageAliases: Mapping | null;
|
|
193
|
+
};
|
|
194
|
+
/**
|
|
195
|
+
* Determines a concrete file path for given module id.
|
|
196
|
+
* @param moduleID - Module id to determine.
|
|
197
|
+
* @param aliases - Mapping of aliases to take into account.
|
|
198
|
+
* @param moduleReplacements - Mapping of replacements to take into account.
|
|
199
|
+
* @param extensions - List of file and module extensions to take into account.
|
|
200
|
+
* @param context - File path to determine relative to.
|
|
201
|
+
* @param referencePath - Path to resolve local modules relative to.
|
|
202
|
+
* @param pathsToIgnore - Paths which marks location to ignore.
|
|
203
|
+
* @param relativeModuleLocations - List of relative file path to search for
|
|
204
|
+
* modules in.
|
|
205
|
+
* @param packageEntryFileNames - List of package entry file names to search
|
|
206
|
+
* for. The magic name "__package__" will search for an appreciate entry in a
|
|
207
|
+
* "package.json" file.
|
|
208
|
+
* @param packageMainPropertyNames - List of package file main property names
|
|
209
|
+
* to search for package representing entry module definitions.
|
|
210
|
+
* @param packageAliasPropertyNames - List of package file alias property names
|
|
211
|
+
* to search for package specific module aliases.
|
|
212
|
+
* @param encoding - Encoding to use for file names during file traversing.
|
|
213
|
+
* @returns File path or given module id if determinations has failed or wasn't
|
|
214
|
+
* necessary.
|
|
215
|
+
*/
|
|
216
|
+
export declare const determineModuleFilePath: (moduleID: false | string, aliases?: Mapping, moduleReplacements?: Replacements, extensions?: SpecificExtensions, context?: string, referencePath?: string, pathsToIgnore?: Array<string>, relativeModuleLocations?: Array<string>, packageEntryFileNames?: Array<string>, packageMainPropertyNames?: Array<string>, packageAliasPropertyNames?: Array<string>, encoding?: Encoding) => null | string;
|
|
217
|
+
/**
|
|
218
|
+
* Determines a concrete file path for given module id.
|
|
219
|
+
* @param moduleID - Module id to determine.
|
|
220
|
+
* @param aliases - Mapping of aliases to take into account.
|
|
221
|
+
* @returns The alias applied given module id.
|
|
222
|
+
*/
|
|
223
|
+
export declare const applyAliases: (moduleID: string, aliases: Mapping) => string;
|
|
224
|
+
/**
|
|
225
|
+
* Determines a concrete file path for given module id.
|
|
226
|
+
* @param moduleID - Module id to determine.
|
|
227
|
+
* @param replacements - Mapping of regular expressions to their corresponding
|
|
228
|
+
* replacements.
|
|
229
|
+
* @returns The replacement applied given module id.
|
|
230
|
+
*/
|
|
231
|
+
export declare const applyModuleReplacements: (moduleID: false | string, replacements: Replacements) => false | string;
|
|
232
|
+
/**
|
|
233
|
+
* Determines the nearest package configuration file from given file path.
|
|
234
|
+
* @param start - Reference location to search from.
|
|
235
|
+
* @param fileName - Package configuration file name.
|
|
236
|
+
* @returns Determined file path.
|
|
237
|
+
*/
|
|
238
|
+
export declare const findPackageDescriptorFilePath: (start: Array<string> | string, fileName?: string) => null | string;
|
|
239
|
+
/**
|
|
240
|
+
* Determines the nearest package configuration from given module file path.
|
|
241
|
+
* @param modulePath - Module path to take as reference location (leaf in
|
|
242
|
+
* tree).
|
|
243
|
+
* @param fileName - Package configuration file name.
|
|
244
|
+
* @returns A object containing found parsed configuration an their
|
|
245
|
+
* corresponding file path.
|
|
246
|
+
*/
|
|
247
|
+
export declare const getClosestPackageDescriptor: (modulePath: string, fileName?: string) => null | PackageDescriptor;
|