@rspack/core 1.0.8 → 1.0.9

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/dist/Chunk.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { type JsChunk, type JsCompilation } from "@rspack/binding";
1
+ import { type JsChunk, type JsChunkPathData, type JsCompilation } from "@rspack/binding";
2
2
  import { Compilation } from ".";
3
3
  import { ChunkGroup } from "./ChunkGroup";
4
4
  export declare class Chunk {
@@ -37,4 +37,5 @@ export declare class Chunk {
37
37
  * @internal
38
38
  */
39
39
  __internal__innerUkey(): number;
40
+ __internal_to_path_data_chunk(): JsChunkPathData;
40
41
  }
package/dist/Chunk.js CHANGED
@@ -105,6 +105,14 @@ class Chunk {
105
105
  __internal__innerUkey() {
106
106
  return __classPrivateFieldGet(this, _Chunk_inner, "f").__inner_ukey;
107
107
  }
108
+ __internal_to_path_data_chunk() {
109
+ return {
110
+ id: this.id,
111
+ name: this.name,
112
+ hash: this.hash,
113
+ contentHash: this.contentHash
114
+ };
115
+ }
108
116
  }
109
117
  exports.Chunk = Chunk;
110
118
  _Chunk_inner = new WeakMap(), _Chunk_innerCompilation = new WeakMap();
@@ -37,7 +37,9 @@ export interface Asset {
37
37
  source: Source;
38
38
  info: AssetInfo;
39
39
  }
40
- export type PathData = JsPathData;
40
+ export type PathData = Omit<JsPathData, "chunk"> & {
41
+ chunk?: Chunk | binding.JsChunkPathData;
42
+ };
41
43
  export interface LogEntry {
42
44
  type: string;
43
45
  args: any[];
@@ -375,19 +377,32 @@ export declare class Compilation {
375
377
  static PROCESS_ASSETS_STAGE_REPORT: number;
376
378
  }
377
379
  export type EntryData = binding.JsEntryData;
380
+ /**
381
+ * Copied from `lib.es2015.iterable.d.ts` in TS 5.6 for compatibility
382
+ * 1. In 5.6 and after, `IterableIterator` cannot be assigned to 'MapIterator'
383
+ * 2. Before 5.6, Cannot find name 'MapIterator'
384
+ * @see https://devblogs.microsoft.com/typescript/announcing-typescript-5-6/#iterator-helper-methods
385
+ */
386
+ interface IteratorObject<T, TReturn = unknown, TNext = unknown> extends Iterator<T, TReturn, TNext> {
387
+ [Symbol.iterator](): IteratorObject<T, TReturn, TNext>;
388
+ }
389
+ type BuiltinIteratorReturn = any;
390
+ interface MapIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
391
+ [Symbol.iterator](): MapIterator<T>;
392
+ }
378
393
  export declare class Entries implements Map<string, EntryData> {
379
394
  #private;
380
395
  constructor(data: binding.JsEntries);
381
396
  clear(): void;
382
397
  forEach(callback: (value: binding.JsEntryData, key: string, map: Map<string, binding.JsEntryData>) => void, thisArg?: any): void;
383
398
  get size(): number;
384
- entries(): IterableIterator<[string, binding.JsEntryData]>;
385
- values(): IterableIterator<binding.JsEntryData>;
386
- [Symbol.iterator](): IterableIterator<[string, binding.JsEntryData]>;
399
+ entries(): MapIterator<[string, binding.JsEntryData]>;
400
+ values(): MapIterator<binding.JsEntryData>;
401
+ [Symbol.iterator](): MapIterator<[string, binding.JsEntryData]>;
387
402
  get [Symbol.toStringTag](): string;
388
403
  has(key: string): boolean;
389
404
  set(key: string, value: EntryData): this;
390
405
  delete(key: string): boolean;
391
406
  get(key: string): EntryData | undefined;
392
- keys(): IterableIterator<string>;
407
+ keys(): MapIterator<string>;
393
408
  }
@@ -522,16 +522,36 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
522
522
  return warnings;
523
523
  }
524
524
  getPath(filename, data = {}) {
525
- return __classPrivateFieldGet(this, _Compilation_inner, "f").getPath(filename, data);
525
+ return __classPrivateFieldGet(this, _Compilation_inner, "f").getPath(filename, {
526
+ ...data,
527
+ chunk: data.chunk instanceof Chunk_1.Chunk
528
+ ? data.chunk.__internal_to_path_data_chunk()
529
+ : data.chunk
530
+ });
526
531
  }
527
532
  getPathWithInfo(filename, data = {}) {
528
- return __classPrivateFieldGet(this, _Compilation_inner, "f").getPathWithInfo(filename, data);
533
+ return __classPrivateFieldGet(this, _Compilation_inner, "f").getPathWithInfo(filename, {
534
+ ...data,
535
+ chunk: data.chunk instanceof Chunk_1.Chunk
536
+ ? data.chunk.__internal_to_path_data_chunk()
537
+ : data.chunk
538
+ });
529
539
  }
530
540
  getAssetPath(filename, data = {}) {
531
- return __classPrivateFieldGet(this, _Compilation_inner, "f").getAssetPath(filename, data);
541
+ return __classPrivateFieldGet(this, _Compilation_inner, "f").getAssetPath(filename, {
542
+ ...data,
543
+ chunk: data.chunk instanceof Chunk_1.Chunk
544
+ ? data.chunk.__internal_to_path_data_chunk()
545
+ : data.chunk
546
+ });
532
547
  }
533
548
  getAssetPathWithInfo(filename, data = {}) {
534
- return __classPrivateFieldGet(this, _Compilation_inner, "f").getAssetPathWithInfo(filename, data);
549
+ return __classPrivateFieldGet(this, _Compilation_inner, "f").getAssetPathWithInfo(filename, {
550
+ ...data,
551
+ chunk: data.chunk instanceof Chunk_1.Chunk
552
+ ? data.chunk.__internal_to_path_data_chunk()
553
+ : data.chunk
554
+ });
535
555
  }
536
556
  getLogger(name) {
537
557
  if (!name) {
@@ -1,64 +1,9 @@
1
1
  import { BuiltinPluginName } from "@rspack/binding";
2
+ import type { Externals } from "..";
2
3
  export declare const ExternalsPlugin: {
3
- new (type: string, externals: string | RegExp | Record<string, string | boolean | string[] | Record<string, string | string[]>> | ((args_0: {
4
- context?: string | undefined;
5
- dependencyType?: string | undefined;
6
- request?: string | undefined;
7
- contextInfo?: {
8
- issuer: string;
9
- } | undefined;
10
- }, args_1: (args_0: Error | undefined, args_1: string | boolean | string[] | Record<string, string | string[]> | undefined, args_2: "module" | "global" | "system" | "promise" | "commonjs" | "umd" | "amd" | "jsonp" | "import" | "commonjs2" | "var" | "assign" | "this" | "window" | "self" | "commonjs-module" | "commonjs-static" | "amd-require" | "umd2" | "module-import" | "script" | "node-commonjs" | undefined, ...args_3: unknown[]) => void, ...args_2: unknown[]) => unknown) | ((args_0: {
11
- context?: string | undefined;
12
- dependencyType?: string | undefined;
13
- request?: string | undefined;
14
- contextInfo?: {
15
- issuer: string;
16
- } | undefined;
17
- }, ...args_1: unknown[]) => Promise<string | boolean | string[] | Record<string, string | string[]>>) | (string | RegExp | Record<string, string | boolean | string[] | Record<string, string | string[]>> | ((args_0: {
18
- context?: string | undefined;
19
- dependencyType?: string | undefined;
20
- request?: string | undefined;
21
- contextInfo?: {
22
- issuer: string;
23
- } | undefined;
24
- }, args_1: (args_0: Error | undefined, args_1: string | boolean | string[] | Record<string, string | string[]> | undefined, args_2: "module" | "global" | "system" | "promise" | "commonjs" | "umd" | "amd" | "jsonp" | "import" | "commonjs2" | "var" | "assign" | "this" | "window" | "self" | "commonjs-module" | "commonjs-static" | "amd-require" | "umd2" | "module-import" | "script" | "node-commonjs" | undefined, ...args_3: unknown[]) => void, ...args_2: unknown[]) => unknown) | ((args_0: {
25
- context?: string | undefined;
26
- dependencyType?: string | undefined;
27
- request?: string | undefined;
28
- contextInfo?: {
29
- issuer: string;
30
- } | undefined;
31
- }, ...args_1: unknown[]) => Promise<string | boolean | string[] | Record<string, string | string[]>>))[]): {
4
+ new (type: string, externals: Externals): {
32
5
  name: BuiltinPluginName;
33
- _args: [type: string, externals: string | RegExp | Record<string, string | boolean | string[] | Record<string, string | string[]>> | ((args_0: {
34
- context?: string | undefined;
35
- dependencyType?: string | undefined;
36
- request?: string | undefined;
37
- contextInfo?: {
38
- issuer: string;
39
- } | undefined;
40
- }, args_1: (args_0: Error | undefined, args_1: string | boolean | string[] | Record<string, string | string[]> | undefined, args_2: "module" | "global" | "system" | "promise" | "commonjs" | "umd" | "amd" | "jsonp" | "import" | "commonjs2" | "var" | "assign" | "this" | "window" | "self" | "commonjs-module" | "commonjs-static" | "amd-require" | "umd2" | "module-import" | "script" | "node-commonjs" | undefined, ...args_3: unknown[]) => void, ...args_2: unknown[]) => unknown) | ((args_0: {
41
- context?: string | undefined;
42
- dependencyType?: string | undefined;
43
- request?: string | undefined;
44
- contextInfo?: {
45
- issuer: string;
46
- } | undefined;
47
- }, ...args_1: unknown[]) => Promise<string | boolean | string[] | Record<string, string | string[]>>) | (string | RegExp | Record<string, string | boolean | string[] | Record<string, string | string[]>> | ((args_0: {
48
- context?: string | undefined;
49
- dependencyType?: string | undefined;
50
- request?: string | undefined;
51
- contextInfo?: {
52
- issuer: string;
53
- } | undefined;
54
- }, args_1: (args_0: Error | undefined, args_1: string | boolean | string[] | Record<string, string | string[]> | undefined, args_2: "module" | "global" | "system" | "promise" | "commonjs" | "umd" | "amd" | "jsonp" | "import" | "commonjs2" | "var" | "assign" | "this" | "window" | "self" | "commonjs-module" | "commonjs-static" | "amd-require" | "umd2" | "module-import" | "script" | "node-commonjs" | undefined, ...args_3: unknown[]) => void, ...args_2: unknown[]) => unknown) | ((args_0: {
55
- context?: string | undefined;
56
- dependencyType?: string | undefined;
57
- request?: string | undefined;
58
- contextInfo?: {
59
- issuer: string;
60
- } | undefined;
61
- }, ...args_1: unknown[]) => Promise<string | boolean | string[] | Record<string, string | string[]>>))[]];
6
+ _args: [type: string, externals: Externals];
62
7
  affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
63
8
  raw(compiler: import("../Compiler").Compiler): import("@rspack/binding").BuiltinPlugin;
64
9
  apply(compiler: import("../Compiler").Compiler): void;
@@ -489,7 +489,11 @@ function getRawJavascriptParserOptions(parser) {
489
489
  ? ["..."]
490
490
  : []
491
491
  : parser.worker,
492
- overrideStrict: parser.overrideStrict
492
+ overrideStrict: parser.overrideStrict,
493
+ requireAsExpression: parser.requireAsExpression,
494
+ requireDynamic: parser.requireDynamic,
495
+ requireResolve: parser.requireResolve,
496
+ importDynamic: parser.importDynamic
493
497
  };
494
498
  }
495
499
  function getRawAssetParserOptions(parser) {
@@ -168,6 +168,10 @@ const applyJavascriptParserOptionsDefaults = (parserOptions) => {
168
168
  D(parserOptions, "exprContextCritical", true);
169
169
  D(parserOptions, "wrappedContextCritical", false);
170
170
  D(parserOptions, "strictExportPresence", false);
171
+ D(parserOptions, "requireAsExpression", true);
172
+ D(parserOptions, "requireDynamic", true);
173
+ D(parserOptions, "requireResolve", true);
174
+ D(parserOptions, "importDynamic", true);
171
175
  D(parserOptions, "worker", ["..."]);
172
176
  D(parserOptions, "importMeta", true);
173
177
  };
@@ -0,0 +1,293 @@
1
+ import type { JsAssetInfo } from "@rspack/binding";
2
+ import type { PathData } from "../Compilation";
3
+ export type FilenameTemplate = string;
4
+ export type Filename = FilenameTemplate | ((pathData: PathData, assetInfo?: JsAssetInfo) => string);
5
+ /** Name of the configuration. Used when loading multiple configurations. */
6
+ export type Name = string;
7
+ /** A list of name defining all sibling configurations it depends on. Dependent configurations need to be compiled first. */
8
+ export type Dependencies = Name[];
9
+ /**
10
+ * The context configuration is used to set the base directory for Rspack builds.
11
+ * @default process.cwd()
12
+ * */
13
+ export type Context = string;
14
+ /**
15
+ * The mode configuration is used to set the build mode of Rspack to enable the default optimization strategy.
16
+ * @default 'production'
17
+ * */
18
+ export type Mode = "development" | "production" | "none";
19
+ export type Falsy = false | "" | 0 | null | undefined;
20
+ /** The publicPath of the resource referenced by this entry. */
21
+ export type PublicPath = "auto" | Filename;
22
+ /** The baseURI of the resource referenced by this entry. */
23
+ export type BaseUri = string;
24
+ /** How this entry load other chunks. */
25
+ export type ChunkLoadingType = string | "jsonp" | "import-scripts" | "require" | "async-node" | "import";
26
+ /** How this entry load other chunks. */
27
+ export type ChunkLoading = false | ChunkLoadingType;
28
+ /** Whether to create a load-on-demand asynchronous chunk for entry. */
29
+ export type AsyncChunks = boolean;
30
+ /** Option to set the method of loading WebAssembly Modules. */
31
+ export type WasmLoadingType = string | "fetch-streaming" | "fetch" | "async-node";
32
+ /** Option to set the method of loading WebAssembly Modules. */
33
+ export type WasmLoading = false | WasmLoadingType;
34
+ export type ScriptType = false | "text/javascript" | "module";
35
+ export type LibraryCustomUmdObject = {
36
+ amd?: string;
37
+ commonjs?: string;
38
+ root?: string | string[];
39
+ };
40
+ /** Specify a name for the library. */
41
+ export type LibraryName = string | string[] | LibraryCustomUmdObject;
42
+ export type LibraryCustomUmdCommentObject = {
43
+ amd?: string;
44
+ commonjs?: string;
45
+ commonjs2?: string;
46
+ root?: string;
47
+ };
48
+ /** Use a container(defined in global space) for calling define/require functions in an AMD module. */
49
+ export type AmdContainer = string;
50
+ /** Add a comment in the UMD wrapper. */
51
+ export type AuxiliaryComment = string | LibraryCustomUmdCommentObject;
52
+ /** Specify which export should be exposed as a library. */
53
+ export type LibraryExport = string | string[];
54
+ /** Configure how the library will be exposed. */
55
+ export type LibraryType = string | "var" | "module" | "assign" | "assign-properties" | "this" | "window" | "self" | "global" | "commonjs" | "commonjs2" | "commonjs-module" | "commonjs-static" | "amd" | "amd-require" | "umd" | "umd2" | "jsonp" | "system";
56
+ /** When using output.library.type: "umd", setting output.library.umdNamedDefine to true will name the AMD module of the UMD build. */
57
+ export type UmdNamedDefine = boolean;
58
+ /** Options for library. */
59
+ export type LibraryOptions = {
60
+ /** Use a container(defined in global space) for calling define/require functions in an AMD module. */
61
+ amdContainer?: AmdContainer;
62
+ /** Add a comment in the UMD wrapper. */
63
+ auxiliaryComment?: AuxiliaryComment;
64
+ /** Specify which export should be exposed as a library. */
65
+ export?: LibraryExport;
66
+ /** Specify a name for the library. */
67
+ name?: LibraryName;
68
+ /** Configure how the library will be exposed. */
69
+ type: LibraryType;
70
+ /**
71
+ * When using output.library.type: "umd", setting output.library.umdNamedDefine to true will name the AMD module of the UMD build.
72
+ * Otherwise, an anonymous define is used.
73
+ * */
74
+ umdNamedDefine?: UmdNamedDefine;
75
+ };
76
+ /** Options for library. */
77
+ export type Library = LibraryName | LibraryOptions | undefined;
78
+ /** The layer of this entry. */
79
+ export type Layer = string | null;
80
+ /** The filename of the entry chunk. */
81
+ export type EntryFilename = Filename;
82
+ /** The name of the runtime chunk. */
83
+ export type EntryRuntime = false | string;
84
+ /** The path to the entry module. */
85
+ export type EntryItem = string | string[];
86
+ /** The entry that the current entry depends on. With dependOn option you can share the modules from one entry chunk to another. */
87
+ export type EntryDependOn = string | string[];
88
+ export type EntryDescription = {
89
+ /**
90
+ * The path to the entry module.
91
+ * @default './src/index.js'
92
+ * */
93
+ import: EntryItem;
94
+ /**
95
+ * The name of the runtime chunk.
96
+ * When runtime is set, a new runtime chunk will be created.
97
+ * You can also set it to false to avoid a new runtime chunk.
98
+ * */
99
+ runtime?: EntryRuntime;
100
+ /** The publicPath of the resource referenced by this entry. */
101
+ publicPath?: PublicPath;
102
+ /** The baseURI of the resource referenced by this entry. */
103
+ baseUri?: BaseUri;
104
+ /** How this entry load other chunks. */
105
+ chunkLoading?: ChunkLoading;
106
+ /** Whether to create a load-on-demand asynchronous chunk for this entry. */
107
+ asyncChunks?: AsyncChunks;
108
+ /** Option to set the method of loading WebAssembly Modules. */
109
+ wasmLoading?: WasmLoading;
110
+ /** The filename of the entry chunk. */
111
+ filename?: EntryFilename;
112
+ /** The format of the chunk generated by this entry as a library. */
113
+ library?: LibraryOptions;
114
+ /** The entry that the current entry depends on. With dependOn option you can share the modules from one entry chunk to another. */
115
+ dependOn?: EntryDependOn;
116
+ /** The layer of this entry, make the corresponding configuration take effect through layer matching in SplitChunks, Rules, Stats, and Externals. */
117
+ layer?: Layer;
118
+ };
119
+ export type EntryUnnamed = EntryItem;
120
+ export type EntryObject = Record<string, EntryItem | EntryDescription>;
121
+ /** A static entry. */
122
+ export type EntryStatic = EntryObject | EntryUnnamed;
123
+ /** A Function returning entry options. */
124
+ export type EntryDynamic = () => EntryStatic | Promise<EntryStatic>;
125
+ /** The entry options for building */
126
+ export type Entry = EntryStatic | EntryDynamic;
127
+ /**
128
+ * Path alias
129
+ * @example
130
+ * ```js
131
+ * {
132
+ * "@": path.resolve(__dirname, './src'),
133
+ * "abc$": path.resolve(__dirname, './node_modules/abc/index.js'),
134
+ * }
135
+ * // - require("@/a") will attempt to resolve <root>/src/a.
136
+ * // - require("abc") will attempt to resolve <root>/src/abc.
137
+ * // - require("abc/file.js") will not match, and it will attempt to resolve node_modules/abc/file.js.
138
+ * ```
139
+ * */
140
+ export type ResolveAlias = {
141
+ [x: string]: string | false | (string | false)[];
142
+ };
143
+ /** The replacement of [tsconfig-paths-webpack-plugin](https://www.npmjs.com/package/tsconfig-paths-webpack-plugin) in Rspack. */
144
+ export type ResolveTsConfig = string | {
145
+ configFile: string;
146
+ references?: string[] | "auto" | undefined;
147
+ };
148
+ /** Used to configure the Rspack module resolution */
149
+ export type ResolveOptions = {
150
+ /** Path alias */
151
+ alias?: ResolveAlias;
152
+ /** Same as node's [conditionNames](https://nodejs.org/api/packages.html#conditional-exports) for the exports and imports fields in package.json. */
153
+ conditionNames?: string[];
154
+ /**
155
+ * Parse modules in order.
156
+ * @default [".js", ".json", ".wasm"]
157
+ * */
158
+ extensions?: string[];
159
+ /** Redirect module requests when normal resolving fails. */
160
+ fallback?: ResolveAlias;
161
+ /** Try to parse the fields in package.json */
162
+ mainFields?: string[];
163
+ /**
164
+ * The filename suffix when resolving directories, e.g. require('. /dir/') will try to resolve '. /dir/index'.
165
+ * @default ['index']
166
+ */
167
+ mainFiles?: string[];
168
+ /**
169
+ * The name of the directory to use when resolving dependencies.
170
+ * @default ["node_modules"]
171
+ */
172
+ modules?: string[];
173
+ /**
174
+ * When enabled, require('file') will first look for the . /file file in the current directory, not <modules>/file.
175
+ * @default false
176
+ */
177
+ preferRelative?: boolean;
178
+ /**
179
+ * Opt for absolute paths when resolving, in relation to resolve.roots.
180
+ * @default false
181
+ */
182
+ preferAbsolute?: boolean;
183
+ /**
184
+ * Whether to resolve symlinks to their symlinked location.
185
+ * @default true
186
+ */
187
+ symlinks?: boolean;
188
+ /**
189
+ * By default, It changes to true if resolve.extensions contains an empty string;
190
+ * otherwise, this value changes to false.
191
+ */
192
+ enforceExtension?: boolean;
193
+ /**
194
+ * Customize the imports field in package.json which are used to provide the internal requests of a package (requests starting with # are considered internal).
195
+ * @default ["imports"]
196
+ */
197
+ importsFields?: string[];
198
+ /**
199
+ * The JSON files to use for descriptions.
200
+ * @default ['package.json']
201
+ */
202
+ descriptionFiles?: string[];
203
+ /** The replacement of [tsconfig-paths-webpack-plugin](https://www.npmjs.com/package/tsconfig-paths-webpack-plugin) in Rspack. */
204
+ tsConfig?: ResolveTsConfig;
205
+ /**
206
+ * No longer resolve extensions, no longer resolve mainFiles in package.json (but does not affect requests from mainFiles, browser, alias).
207
+ * @default false
208
+ * */
209
+ fullySpecified?: boolean;
210
+ /**
211
+ * Customize the exports field in package.json.
212
+ * @default ["exports"]
213
+ * */
214
+ exportsFields?: string[];
215
+ /** Define alias for the extension. */
216
+ extensionAlias?: Record<string, string | string[]>;
217
+ /**
218
+ * Define a field, such as browser, that should be parsed in accordance with this [specification](https://github.com/defunctzombie/package-browser-field-spec).
219
+ * @default ['browser']
220
+ * */
221
+ aliasFields?: string[];
222
+ /**
223
+ * A list of resolve restrictions to restrict the paths that a request can be resolved on.
224
+ * @default []
225
+ * */
226
+ restrictions?: string[];
227
+ /**
228
+ * A list of directories where server-relative URLs (beginning with '/') are resolved.
229
+ * It defaults to the context configuration option.
230
+ * On systems other than Windows, these requests are initially resolved as an absolute path.
231
+ * @default []
232
+ */
233
+ roots?: string[];
234
+ /** Customize the Resolve configuration based on the module type. */
235
+ byDependency?: Record<string, ResolveOptions>;
236
+ };
237
+ /** Used to configure the Rspack module resolution */
238
+ export type Resolve = ResolveOptions;
239
+ /**
240
+ * Specify the default type of externals.
241
+ * `amd`, `umd`, `system` and `jsonp` externals depend on the `output.libraryTarget` being set to the same value e.g. you can only consume amd externals within an amd library.
242
+ * @default 'var'
243
+ */
244
+ export type ExternalsType = "var" | "module" | "assign" | "this" | "window" | "self" | "global" | "commonjs" | "commonjs2" | "commonjs-module" | "commonjs-static" | "amd" | "amd-require" | "umd" | "umd2" | "jsonp" | "system" | "promise" | "import" | "module-import" | "script" | "node-commonjs";
245
+ /**
246
+ * The dependency used for the external.
247
+ */
248
+ export type ExternalItemValue = string | boolean | string[] | Record<string, string | string[]>;
249
+ /**
250
+ * If an dependency matches exactly a property of the object, the property value is used as dependency.
251
+ */
252
+ export type ExternalItemObjectUnknown = {
253
+ [x: string]: ExternalItemValue;
254
+ };
255
+ /**
256
+ * Data object passed as argument when a function is set for 'externals'.
257
+ */
258
+ export type ExternalItemFunctionData = {
259
+ context?: string;
260
+ dependencyType?: string;
261
+ request?: string;
262
+ contextInfo?: {
263
+ issuer: string;
264
+ };
265
+ };
266
+ /**
267
+ * Prevent bundling of certain imported package and instead retrieve these external dependencies at runtime.
268
+ *
269
+ * @example
270
+ * ```js
271
+ * // jquery lib will be excluded from bundling.
272
+ * module.exports = {
273
+ * externals: {
274
+ * jquery: 'jQuery',
275
+ * }
276
+ * }
277
+ * ```
278
+ * */
279
+ export type ExternalItem = string | RegExp | ExternalItemObjectUnknown | ((data: ExternalItemFunctionData, callback: (err?: Error, result?: ExternalItemValue, type?: ExternalsType) => void) => void) | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
280
+ /**
281
+ * Prevent bundling of certain imported packages and instead retrieve these external dependencies at runtime.
282
+ *
283
+ * @example
284
+ * ```js
285
+ * // jquery lib will be excluded from bundling.
286
+ * module.exports = {
287
+ * externals: {
288
+ * jquery: 'jQuery',
289
+ * }
290
+ * }
291
+ * ```
292
+ * */
293
+ export type Externals = ExternalItem | ExternalItem[];
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //#endregion