@rspack/core 1.0.0-alpha.5 → 1.0.0-beta.0

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.
Files changed (89) hide show
  1. package/compiled/zod/index.d.ts +138 -52
  2. package/compiled/zod/index.js +300 -103
  3. package/compiled/zod/package.json +1 -1
  4. package/compiled/zod-validation-error/index.js +6 -6
  5. package/dist/Compilation.d.ts +21 -3
  6. package/dist/Compilation.js +64 -49
  7. package/dist/Compiler.js +28 -28
  8. package/dist/ErrorHelpers.js +2 -4
  9. package/dist/Module.js +2 -6
  10. package/dist/ModuleTypeConstants.d.ts +45 -69
  11. package/dist/ModuleTypeConstants.js +24 -77
  12. package/dist/Stats.js +4 -6
  13. package/dist/Template.d.ts +31 -147
  14. package/dist/Template.js +40 -236
  15. package/dist/builtin-loader/lightningcss/index.d.ts +89 -0
  16. package/dist/builtin-loader/lightningcss/index.js +175 -0
  17. package/dist/builtin-plugin/BannerPlugin.d.ts +24 -48
  18. package/dist/builtin-plugin/DefinePlugin.js +9 -13
  19. package/dist/builtin-plugin/EntryPlugin.d.ts +2 -2
  20. package/dist/builtin-plugin/ExternalsPlugin.d.ts +24 -0
  21. package/dist/builtin-plugin/HtmlRspackPlugin.d.ts +8 -8
  22. package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +2 -2
  23. package/dist/builtin-plugin/LightningCssMiminizerRspackPlugin.d.ts +10 -3
  24. package/dist/builtin-plugin/LightningCssMiminizerRspackPlugin.js +4 -1
  25. package/dist/builtin-plugin/SplitChunksPlugin.js +5 -15
  26. package/dist/builtin-plugin/SwcJsMinimizerPlugin.js +15 -23
  27. package/dist/builtin-plugin/base.js +1 -3
  28. package/dist/builtin-plugin/css-extract/hmr/hotModuleReplacement.d.ts +3 -3
  29. package/dist/builtin-plugin/css-extract/hmr/hotModuleReplacement.js +17 -66
  30. package/dist/builtin-plugin/css-extract/hmr/normalizeUrl.d.ts +2 -0
  31. package/dist/builtin-plugin/css-extract/hmr/{normalize-url.js → normalizeUrl.js} +15 -24
  32. package/dist/builtin-plugin/css-extract/loader.js +5 -5
  33. package/dist/config/adapter.d.ts +1 -1
  34. package/dist/config/adapter.js +24 -23
  35. package/dist/config/adapterRuleUse.d.ts +5 -5
  36. package/dist/config/adapterRuleUse.js +23 -1
  37. package/dist/config/browserslistTargetHandler.d.ts +17 -15
  38. package/dist/config/browserslistTargetHandler.js +27 -33
  39. package/dist/config/defaults.js +20 -21
  40. package/dist/config/normalization.d.ts +2 -0
  41. package/dist/config/normalization.js +5 -5
  42. package/dist/config/target.d.ts +48 -109
  43. package/dist/config/target.js +50 -86
  44. package/dist/config/zod.d.ts +2391 -2205
  45. package/dist/config/zod.js +28 -18
  46. package/dist/container/ContainerPlugin.d.ts +7 -7
  47. package/dist/container/options.js +1 -1
  48. package/dist/exports.d.ts +4 -4
  49. package/dist/exports.js +2 -2
  50. package/dist/lib/CacheFacade.js +1 -0
  51. package/dist/lib/ModuleFilenameHelpers.js +1 -3
  52. package/dist/lib/cache/mergeEtags.js +5 -11
  53. package/dist/lib/formatLocation.js +3 -5
  54. package/dist/loader-runner/LoaderLoadingError.d.ts +11 -1
  55. package/dist/loader-runner/LoaderLoadingError.js +3 -5
  56. package/dist/loader-runner/index.js +7 -9
  57. package/dist/loader-runner/loadLoader.d.ts +11 -2
  58. package/dist/loader-runner/loadLoader.js +17 -19
  59. package/dist/logging/createConsoleLogger.js +2 -6
  60. package/dist/logging/truncateArgs.js +5 -9
  61. package/dist/node/nodeConsole.js +1 -3
  62. package/dist/stats/DefaultStatsFactoryPlugin.js +17 -7
  63. package/dist/stats/DefaultStatsPresetPlugin.js +4 -4
  64. package/dist/stats/DefaultStatsPrinterPlugin.js +11 -16
  65. package/dist/stats/StatsFactory.js +13 -17
  66. package/dist/stats/StatsPrinter.js +7 -9
  67. package/dist/util/AssetInfo.js +11 -7
  68. package/dist/util/SplitChunkSize.js +1 -1
  69. package/dist/util/cleverMerge.d.ts +33 -57
  70. package/dist/util/cleverMerge.js +89 -145
  71. package/dist/util/comparators.js +3 -5
  72. package/dist/util/createHash.d.ts +4 -3
  73. package/dist/util/createHash.js +31 -45
  74. package/dist/util/fs.js +9 -13
  75. package/dist/util/hash/BatchedHash.d.ts +24 -9
  76. package/dist/util/hash/BatchedHash.js +16 -13
  77. package/dist/util/hash/index.d.ts +9 -9
  78. package/dist/util/hash/index.js +14 -11
  79. package/dist/util/hash/md4.d.ts +29 -2
  80. package/dist/util/hash/md4.js +7 -3
  81. package/dist/util/hash/wasm-hash.d.ts +52 -5
  82. package/dist/util/hash/wasm-hash.js +19 -22
  83. package/dist/util/hash/xxhash64.d.ts +29 -2
  84. package/dist/util/hash/xxhash64.js +7 -3
  85. package/dist/util/identifier.js +9 -15
  86. package/dist/util/index.js +1 -1
  87. package/dist/util/memoize.js +7 -9
  88. package/package.json +9 -8
  89. package/dist/builtin-plugin/css-extract/hmr/normalize-url.d.ts +0 -2
@@ -1,145 +1,92 @@
1
+ "use strict";
1
2
  /*
2
3
  MIT License http://www.opensource.org/licenses/mit-license.php
3
4
  Author Sean Larkin @TheLarkInn
4
5
  */
5
- "use strict";
6
- /**
7
- * @type {Readonly<"javascript/auto">}
8
- */
9
- const JAVASCRIPT_MODULE_TYPE_AUTO = "javascript/auto";
10
- /**
11
- * @type {Readonly<"javascript/dynamic">}
12
- */
13
- const JAVASCRIPT_MODULE_TYPE_DYNAMIC = "javascript/dynamic";
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.WEBPACK_MODULE_TYPE_LAZY_COMPILATION_PROXY = exports.WEBPACK_MODULE_TYPE_CONSUME_SHARED_MODULE = exports.WEBPACK_MODULE_TYPE_PROVIDE = exports.WEBPACK_MODULE_TYPE_REMOTE = exports.WEBPACK_MODULE_TYPE_FALLBACK = exports.WEBPACK_MODULE_TYPE_RUNTIME = exports.ASSET_MODULE_TYPE_RAW_DATA_URL = exports.ASSET_MODULE_TYPE_SOURCE = exports.ASSET_MODULE_TYPE_RESOURCE = exports.ASSET_MODULE_TYPE_INLINE = exports.ASSET_MODULE_TYPE = exports.CSS_MODULE_TYPE_AUTO = exports.CSS_MODULE_TYPE_MODULE = exports.CSS_MODULE_TYPE_GLOBAL = exports.CSS_MODULE_TYPE = exports.WEBASSEMBLY_MODULE_TYPE_SYNC = exports.WEBASSEMBLY_MODULE_TYPE_ASYNC = exports.JSON_MODULE_TYPE = exports.JAVASCRIPT_MODULE_TYPE_ESM = exports.JAVASCRIPT_MODULE_TYPE_DYNAMIC = exports.JAVASCRIPT_MODULE_TYPE_AUTO = void 0;
8
+ exports.JAVASCRIPT_MODULE_TYPE_AUTO = "javascript/auto";
9
+ exports.JAVASCRIPT_MODULE_TYPE_DYNAMIC = "javascript/dynamic";
14
10
  /**
15
- * @type {Readonly<"javascript/esm">}
16
11
  * This is the module type used for _strict_ ES Module syntax. This means that all legacy formats
17
12
  * that webpack supports (CommonJS, AMD, SystemJS) are not supported.
18
13
  */
19
- const JAVASCRIPT_MODULE_TYPE_ESM = "javascript/esm";
14
+ exports.JAVASCRIPT_MODULE_TYPE_ESM = "javascript/esm";
20
15
  /**
21
- * @type {Readonly<"json">}
22
16
  * This is the module type used for JSON files. JSON files are always parsed as ES Module.
23
17
  */
24
- const JSON_MODULE_TYPE = "json";
18
+ exports.JSON_MODULE_TYPE = "json";
25
19
  /**
26
- * @type {Readonly<"webassembly/async">}
27
20
  * This is the module type used for WebAssembly modules. In webpack 5 they are always treated as async modules.
28
21
  *
29
22
  */
30
- const WEBASSEMBLY_MODULE_TYPE_ASYNC = "webassembly/async";
23
+ exports.WEBASSEMBLY_MODULE_TYPE_ASYNC = "webassembly/async";
31
24
  /**
32
- * @type {Readonly<"webassembly/sync">}
33
25
  * This is the module type used for WebAssembly modules. In webpack 4 they are always treated as sync modules.
34
26
  * There is a legacy option to support this usage in webpack 5 and up.
35
27
  */
36
- const WEBASSEMBLY_MODULE_TYPE_SYNC = "webassembly/sync";
28
+ exports.WEBASSEMBLY_MODULE_TYPE_SYNC = "webassembly/sync";
37
29
  /**
38
- * @type {Readonly<"css">}
39
30
  * This is the module type used for CSS files.
40
31
  */
41
- const CSS_MODULE_TYPE = "css";
32
+ exports.CSS_MODULE_TYPE = "css";
42
33
  /**
43
- * @type {Readonly<"css/global">}
44
34
  * This is the module type used for CSS modules files where you need to use `:local` in selector list to hash classes.
45
35
  */
46
- const CSS_MODULE_TYPE_GLOBAL = "css/global";
36
+ exports.CSS_MODULE_TYPE_GLOBAL = "css/global";
47
37
  /**
48
- * @type {Readonly<"css/module">}
49
38
  * This is the module type used for CSS modules files, by default all classes are hashed.
50
39
  */
51
- const CSS_MODULE_TYPE_MODULE = "css/module";
40
+ exports.CSS_MODULE_TYPE_MODULE = "css/module";
52
41
  /**
53
- * @type {Readonly<"css/auto">}
54
42
  * This is the module type used for CSS files, the module will be parsed as CSS modules if it's filename contains `.module.` or `.modules.`.
55
43
  */
56
- const CSS_MODULE_TYPE_AUTO = "css/auto";
44
+ exports.CSS_MODULE_TYPE_AUTO = "css/auto";
57
45
  /**
58
- * @type {Readonly<"asset">}
59
46
  * This is the module type used for automatically choosing between `asset/inline`, `asset/resource` based on asset size limit (8096).
60
47
  */
61
- const ASSET_MODULE_TYPE = "asset";
48
+ exports.ASSET_MODULE_TYPE = "asset";
62
49
  /**
63
- * @type {Readonly<"asset/inline">}
64
50
  * This is the module type used for assets that are inlined as a data URI. This is the equivalent of `url-loader`.
65
51
  */
66
- const ASSET_MODULE_TYPE_INLINE = "asset/inline";
52
+ exports.ASSET_MODULE_TYPE_INLINE = "asset/inline";
67
53
  /**
68
- * @type {Readonly<"asset/resource">}
69
54
  * This is the module type used for assets that are copied to the output directory. This is the equivalent of `file-loader`.
70
55
  */
71
- const ASSET_MODULE_TYPE_RESOURCE = "asset/resource";
56
+ exports.ASSET_MODULE_TYPE_RESOURCE = "asset/resource";
72
57
  /**
73
58
  * @type {Readonly<"asset/source">}
74
59
  * This is the module type used for assets that are imported as source code. This is the equivalent of `raw-loader`.
75
60
  */
76
- const ASSET_MODULE_TYPE_SOURCE = "asset/source";
61
+ exports.ASSET_MODULE_TYPE_SOURCE = "asset/source";
77
62
  /**
78
- * @type {Readonly<"asset/raw-data-url">}
79
63
  * TODO: Document what this asset type is for. See css-loader tests for its usage.
80
64
  */
81
- const ASSET_MODULE_TYPE_RAW_DATA_URL = "asset/raw-data-url";
65
+ exports.ASSET_MODULE_TYPE_RAW_DATA_URL = "asset/raw-data-url";
82
66
  /**
83
- * @type {Readonly<"runtime">}
84
67
  * This is the module type used for the webpack runtime abstractions.
85
68
  */
86
- const WEBPACK_MODULE_TYPE_RUNTIME = "runtime";
69
+ exports.WEBPACK_MODULE_TYPE_RUNTIME = "runtime";
87
70
  /**
88
- * @type {Readonly<"fallback-module">}
89
71
  * This is the module type used for the ModuleFederation feature's FallbackModule class.
90
72
  * TODO: Document this better.
91
73
  */
92
- const WEBPACK_MODULE_TYPE_FALLBACK = "fallback-module";
74
+ exports.WEBPACK_MODULE_TYPE_FALLBACK = "fallback-module";
93
75
  /**
94
- * @type {Readonly<"remote-module">}
95
76
  * This is the module type used for the ModuleFederation feature's RemoteModule class.
96
77
  * TODO: Document this better.
97
78
  */
98
- const WEBPACK_MODULE_TYPE_REMOTE = "remote-module";
79
+ exports.WEBPACK_MODULE_TYPE_REMOTE = "remote-module";
99
80
  /**
100
- * @type {Readonly<"provide-module">}
101
81
  * This is the module type used for the ModuleFederation feature's ProvideModule class.
102
82
  * TODO: Document this better.
103
83
  */
104
- const WEBPACK_MODULE_TYPE_PROVIDE = "provide-module";
84
+ exports.WEBPACK_MODULE_TYPE_PROVIDE = "provide-module";
105
85
  /**
106
- * @type {Readonly<"consume-shared-module">}
107
86
  * This is the module type used for the ModuleFederation feature's ConsumeSharedModule class.
108
87
  */
109
- const WEBPACK_MODULE_TYPE_CONSUME_SHARED_MODULE = "consume-shared-module";
88
+ exports.WEBPACK_MODULE_TYPE_CONSUME_SHARED_MODULE = "consume-shared-module";
110
89
  /**
111
- * @type {Readonly<"lazy-compilation-proxy">}
112
90
  * Module type used for `experiments.lazyCompilation` feature. See `LazyCompilationPlugin` for more information.
113
91
  */
114
- const WEBPACK_MODULE_TYPE_LAZY_COMPILATION_PROXY = "lazy-compilation-proxy";
115
- /** @typedef {"javascript/auto" | "javascript/dynamic" | "javascript/esm"} JavaScriptModuleTypes */
116
- /** @typedef {"json"} JSONModuleType */
117
- /** @typedef {"webassembly/async" | "webassembly/sync"} WebAssemblyModuleTypes */
118
- /** @typedef {"css" | "css/global" | "css/module"} CSSModuleTypes */
119
- /** @typedef {"asset" | "asset/inline" | "asset/resource" | "asset/source" | "asset/raw-data-url"} AssetModuleTypes */
120
- /** @typedef {"runtime" | "fallback-module" | "remote-module" | "provide-module" | "consume-shared-module" | "lazy-compilation-proxy"} WebpackModuleTypes */
121
- /** @typedef {string} UnknownModuleTypes */
122
- /** @typedef {JavaScriptModuleTypes | JSONModuleType | WebAssemblyModuleTypes | CSSModuleTypes | AssetModuleTypes | WebpackModuleTypes | UnknownModuleTypes} ModuleTypes */
123
- exports.ASSET_MODULE_TYPE = ASSET_MODULE_TYPE;
124
- exports.ASSET_MODULE_TYPE_RAW_DATA_URL = ASSET_MODULE_TYPE_RAW_DATA_URL;
125
- exports.ASSET_MODULE_TYPE_SOURCE = ASSET_MODULE_TYPE_SOURCE;
126
- exports.ASSET_MODULE_TYPE_RESOURCE = ASSET_MODULE_TYPE_RESOURCE;
127
- exports.ASSET_MODULE_TYPE_INLINE = ASSET_MODULE_TYPE_INLINE;
128
- exports.JAVASCRIPT_MODULE_TYPE_AUTO = JAVASCRIPT_MODULE_TYPE_AUTO;
129
- exports.JAVASCRIPT_MODULE_TYPE_DYNAMIC = JAVASCRIPT_MODULE_TYPE_DYNAMIC;
130
- exports.JAVASCRIPT_MODULE_TYPE_ESM = JAVASCRIPT_MODULE_TYPE_ESM;
131
- exports.JSON_MODULE_TYPE = JSON_MODULE_TYPE;
132
- exports.WEBASSEMBLY_MODULE_TYPE_ASYNC = WEBASSEMBLY_MODULE_TYPE_ASYNC;
133
- exports.WEBASSEMBLY_MODULE_TYPE_SYNC = WEBASSEMBLY_MODULE_TYPE_SYNC;
134
- exports.CSS_MODULE_TYPE = CSS_MODULE_TYPE;
135
- exports.CSS_MODULE_TYPE_GLOBAL = CSS_MODULE_TYPE_GLOBAL;
136
- exports.CSS_MODULE_TYPE_MODULE = CSS_MODULE_TYPE_MODULE;
137
- exports.CSS_MODULE_TYPE_AUTO = CSS_MODULE_TYPE_AUTO;
138
- exports.WEBPACK_MODULE_TYPE_RUNTIME = WEBPACK_MODULE_TYPE_RUNTIME;
139
- exports.WEBPACK_MODULE_TYPE_FALLBACK = WEBPACK_MODULE_TYPE_FALLBACK;
140
- exports.WEBPACK_MODULE_TYPE_REMOTE = WEBPACK_MODULE_TYPE_REMOTE;
141
- exports.WEBPACK_MODULE_TYPE_PROVIDE = WEBPACK_MODULE_TYPE_PROVIDE;
142
- exports.WEBPACK_MODULE_TYPE_CONSUME_SHARED_MODULE =
143
- WEBPACK_MODULE_TYPE_CONSUME_SHARED_MODULE;
144
- exports.WEBPACK_MODULE_TYPE_LAZY_COMPILATION_PROXY =
145
- WEBPACK_MODULE_TYPE_LAZY_COMPILATION_PROXY;
92
+ exports.WEBPACK_MODULE_TYPE_LAZY_COMPILATION_PROXY = "lazy-compilation-proxy";
package/dist/Stats.js CHANGED
@@ -99,13 +99,11 @@ _Stats_inner = new WeakMap(), _Stats_innerMap = new WeakMap(), _Stats_instances
99
99
  function normalizeStatsPreset(options) {
100
100
  if (typeof options === "boolean" || typeof options === "string")
101
101
  return presetToOptions(options);
102
- else if (!options)
102
+ if (!options)
103
103
  return {};
104
- else {
105
- const obj = { ...presetToOptions(options.preset), ...options };
106
- delete obj.preset;
107
- return obj;
108
- }
104
+ const obj = { ...presetToOptions(options.preset), ...options };
105
+ delete obj.preset;
106
+ return obj;
109
107
  }
110
108
  exports.normalizeStatsPreset = normalizeStatsPreset;
111
109
  function presetToOptions(name) {
@@ -1,193 +1,77 @@
1
- export = Template;
2
1
  /**
3
- * @typedef {Object} RenderManifestOptions
4
- * @property {Chunk} chunk the chunk used to render
5
- * @property {string} hash
6
- * @property {string} fullHash
7
- * @property {OutputOptions} outputOptions
8
- * @property {CodeGenerationResults} codeGenerationResults
9
- * @property {{javascript: ModuleTemplate}} moduleTemplates
10
- * @property {DependencyTemplates} dependencyTemplates
11
- * @property {RuntimeTemplate} runtimeTemplate
12
- * @property {ModuleGraph} moduleGraph
13
- * @property {ChunkGraph} chunkGraph
14
- */
15
- /** @typedef {RenderManifestEntryTemplated | RenderManifestEntryStatic} RenderManifestEntry */
16
- /**
17
- * @typedef {Object} RenderManifestEntryTemplated
18
- * @property {function(): Source} render
19
- * @property {string | function(PathData, AssetInfo=): string} filenameTemplate
20
- * @property {PathData=} pathOptions
21
- * @property {AssetInfo=} info
22
- * @property {string} identifier
23
- * @property {string=} hash
24
- * @property {boolean=} auxiliary
25
- */
26
- /**
27
- * @typedef {Object} RenderManifestEntryStatic
28
- * @property {function(): Source} render
29
- * @property {string} filename
30
- * @property {AssetInfo} info
31
- * @property {string} identifier
32
- * @property {string=} hash
33
- * @property {boolean=} auxiliary
34
- */
35
- /**
36
- * @typedef {Object} HasId
37
- * @property {number | string} id
38
- */
39
- /**
40
- * @typedef {function(Module, number): boolean} ModuleFilterPredicate
2
+ * The following code is modified based on
3
+ * https://github.com/webpack/webpack/blob/4b4ca3b/lib/Template.js
4
+ *
5
+ * MIT Licensed
6
+ * Author Tobias Koppers @sokra
7
+ * Copyright (c) JS Foundation and other contributors
8
+ * https://github.com/webpack/webpack/blob/main/LICENSE
41
9
  */
42
10
  declare class Template {
43
11
  /**
44
12
  *
45
- * @param {Function} fn a runtime function (.runtime.js) "template"
46
- * @returns {string} the updated and normalized function string
13
+ * @param fn a runtime function (.runtime.js) "template"
14
+ * @returns the updated and normalized function string
47
15
  */
48
16
  static getFunctionContent(fn: Function): string;
49
17
  /**
50
- * @param {any} str the string converted to identifier
51
- * @returns {string} created identifier
18
+ * @param str the string converted to identifier
19
+ * @returns created identifier
52
20
  */
53
21
  static toIdentifier(str: any): string;
54
22
  /**
55
23
  *
56
- * @param {string} str string to be converted to commented in bundle code
57
- * @returns {string} returns a commented version of string
24
+ * @param str string to be converted to commented in bundle code
25
+ * @returns returns a commented version of string
58
26
  */
59
27
  static toComment(str: string): string;
60
28
  /**
61
29
  *
62
- * @param {string} str string to be converted to "normal comment"
63
- * @returns {string} returns a commented version of string
30
+ * @param str string to be converted to "normal comment"
31
+ * @returns returns a commented version of string
64
32
  */
65
33
  static toNormalComment(str: string): string;
66
34
  /**
67
- * @param {string} str string path to be normalized
68
- * @returns {string} normalized bundle-safe path
35
+ * @param str string path to be normalized
36
+ * @returns normalized bundle-safe path
69
37
  */
70
38
  static toPath(str: string): string;
71
39
  /**
72
- * @param {number} n number to convert to ident
73
- * @returns {string} returns single character ident
40
+ * @param n number to convert to ident
41
+ * @returns returns single character ident
74
42
  */
75
43
  static numberToIdentifier(n: number): string;
76
44
  /**
77
- * @param {number} n number to convert to ident
78
- * @returns {string} returns single character ident
45
+ * @param n number to convert to ident
46
+ * @returns returns single character ident
79
47
  */
80
48
  static numberToIdentifierContinuation(n: number): string;
81
49
  /**
82
50
  *
83
- * @param {string | string[]} s string to convert to identity
84
- * @returns {string} converted identity
51
+ * @param s string to convert to identity
52
+ * @returns converted identity
85
53
  */
86
54
  static indent(s: string | string[]): string;
87
55
  /**
88
56
  *
89
- * @param {string|string[]} s string to create prefix for
90
- * @param {string} prefix prefix to compose
91
- * @returns {string} returns new prefix string
57
+ * @param s string to create prefix for
58
+ * @param prefix prefix to compose
59
+ * @returns returns new prefix string
92
60
  */
93
61
  static prefix(s: string | string[], prefix: string): string;
94
62
  /**
95
63
  *
96
- * @param {string|string[]} str string or string collection
97
- * @returns {string} returns a single string from array
64
+ * @param str string or string collection
65
+ * @returns returns a single string from array
98
66
  */
99
67
  static asString(str: string | string[]): string;
100
68
  /**
101
- * @typedef {Object} WithId
102
- * @property {string|number} id
103
- */
104
- /**
105
- * @param {WithId[]} modules a collection of modules to get array bounds for
106
- * @returns {[number, number] | false} returns the upper and lower array bounds
69
+ * @param modules a collection of modules to get array bounds for
70
+ * @returns returns the upper and lower array bounds
107
71
  * or false if not every module has a number based id
108
72
  */
109
73
  static getModulesArrayBounds(modules: {
110
74
  id: string | number;
111
75
  }[]): [number, number] | false;
112
- /**
113
- * @param {ChunkRenderContext} renderContext render context
114
- * @param {Module[]} modules modules to render (should be ordered by identifier)
115
- * @param {function(Module): Source} renderModule function to render a module
116
- * @param {string=} prefix applying prefix strings
117
- * @returns {Source | null} rendered chunk modules in a Source object or null if no modules
118
- */
119
- static renderChunkModules(renderContext: ChunkRenderContext, modules: Module[], renderModule: (arg0: Module) => Source, prefix?: string | undefined): Source | null;
120
- /**
121
- * @param {RuntimeModule[]} runtimeModules array of runtime modules in order
122
- * @param {RenderContext & { codeGenerationResults?: CodeGenerationResults }} renderContext render context
123
- * @returns {Source} rendered runtime modules in a Source object
124
- */
125
- static renderRuntimeModules(runtimeModules: RuntimeModule[], renderContext: RenderContext & {
126
- codeGenerationResults?: CodeGenerationResults;
127
- }): Source;
128
- /**
129
- * @param {RuntimeModule[]} runtimeModules array of runtime modules in order
130
- * @param {RenderContext} renderContext render context
131
- * @returns {Source} rendered chunk runtime modules in a Source object
132
- */
133
- static renderChunkRuntimeModules(runtimeModules: RuntimeModule[], renderContext: RenderContext): Source;
134
- }
135
- declare namespace Template {
136
- export { NUMBER_OF_IDENTIFIER_START_CHARS, NUMBER_OF_IDENTIFIER_CONTINUATION_CHARS, Source, OutputOptions, Chunk, ChunkGraph, CodeGenerationResults, AssetInfo, PathData, DependencyTemplates, Module, ModuleGraph, ModuleTemplate, RuntimeModule, RuntimeTemplate, ChunkRenderContext, RenderContext, RenderManifestOptions, RenderManifestEntry, RenderManifestEntryTemplated, RenderManifestEntryStatic, HasId, ModuleFilterPredicate };
137
76
  }
138
- type ChunkRenderContext = any;
139
- type Module = any;
140
- type Source = import("../compiled/webpack-sources").Source;
141
- type RuntimeModule = any;
142
- type RenderContext = any;
143
- type CodeGenerationResults = any;
144
- declare const NUMBER_OF_IDENTIFIER_START_CHARS: number;
145
- declare const NUMBER_OF_IDENTIFIER_CONTINUATION_CHARS: number;
146
- type OutputOptions = any;
147
- type Chunk = any;
148
- type ChunkGraph = any;
149
- type AssetInfo = any;
150
- type PathData = any;
151
- type DependencyTemplates = any;
152
- type ModuleGraph = any;
153
- type ModuleTemplate = any;
154
- type RuntimeTemplate = any;
155
- type RenderManifestOptions = {
156
- /**
157
- * the chunk used to render
158
- */
159
- chunk: Chunk;
160
- hash: string;
161
- fullHash: string;
162
- outputOptions: OutputOptions;
163
- codeGenerationResults: CodeGenerationResults;
164
- moduleTemplates: {
165
- javascript: ModuleTemplate;
166
- };
167
- dependencyTemplates: DependencyTemplates;
168
- runtimeTemplate: RuntimeTemplate;
169
- moduleGraph: ModuleGraph;
170
- chunkGraph: ChunkGraph;
171
- };
172
- type RenderManifestEntry = RenderManifestEntryTemplated | RenderManifestEntryStatic;
173
- type RenderManifestEntryTemplated = {
174
- render: () => Source;
175
- filenameTemplate: string | ((arg0: PathData, arg1: AssetInfo | undefined) => string);
176
- pathOptions?: PathData | undefined;
177
- info?: AssetInfo | undefined;
178
- identifier: string;
179
- hash?: string | undefined;
180
- auxiliary?: boolean | undefined;
181
- };
182
- type RenderManifestEntryStatic = {
183
- render: () => Source;
184
- filename: string;
185
- info: AssetInfo;
186
- identifier: string;
187
- hash?: string | undefined;
188
- auxiliary?: boolean | undefined;
189
- };
190
- type HasId = {
191
- id: number | string;
192
- };
193
- type ModuleFilterPredicate = (arg0: Module, arg1: number) => boolean;
77
+ export { Template };