webpack 5.61.0 → 5.62.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.

Potentially problematic release.


This version of webpack might be problematic. Click here for more details.

Files changed (34) hide show
  1. package/lib/Chunk.js +3 -2
  2. package/lib/Compilation.js +29 -16
  3. package/lib/Compiler.js +13 -11
  4. package/lib/HotModuleReplacementPlugin.js +3 -1
  5. package/lib/cache/PackFileCacheStrategy.js +3 -3
  6. package/lib/config/defaults.js +4 -6
  7. package/lib/dependencies/AMDRequireDependency.js +6 -6
  8. package/lib/dependencies/CommonJsFullRequireDependency.js +5 -1
  9. package/lib/dependencies/CommonJsImportsParserPlugin.js +3 -1
  10. package/lib/dependencies/CommonJsRequireContextDependency.js +5 -1
  11. package/lib/dependencies/ContextDependency.js +1 -0
  12. package/lib/dependencies/ContextDependencyTemplateAsRequireCall.js +4 -1
  13. package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +12 -3
  14. package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +25 -17
  15. package/lib/dependencies/HarmonyImportDependency.js +21 -0
  16. package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +17 -4
  17. package/lib/dependencies/HarmonyImportSpecifierDependency.js +24 -14
  18. package/lib/dependencies/RequireEnsureDependency.js +2 -2
  19. package/lib/hmr/lazyCompilationBackend.js +6 -1
  20. package/lib/node/RequireChunkLoadingRuntimeModule.js +1 -1
  21. package/lib/optimize/ModuleConcatenationPlugin.js +5 -2
  22. package/lib/optimize/SplitChunksPlugin.js +8 -1
  23. package/lib/runtime/AsyncModuleRuntimeModule.js +2 -2
  24. package/lib/sharing/ConsumeSharedRuntimeModule.js +1 -1
  25. package/lib/sharing/ShareRuntimeModule.js +1 -1
  26. package/lib/util/deprecation.js +10 -2
  27. package/lib/util/hash/BatchedHash.js +5 -1
  28. package/lib/util/hash/wasm-hash.js +1 -1
  29. package/lib/webpack.js +1 -2
  30. package/module.d.ts +200 -0
  31. package/package.json +12 -10
  32. package/schemas/WebpackOptions.check.js +1 -1
  33. package/schemas/WebpackOptions.json +45 -21
  34. package/types.d.ts +33 -13
@@ -28,6 +28,8 @@ const HarmonyImportDependency = require("./HarmonyImportDependency");
28
28
 
29
29
  const idsSymbol = Symbol("HarmonyImportSpecifierDependency.ids");
30
30
 
31
+ const { ExportPresenceModes } = HarmonyImportDependency;
32
+
31
33
  class HarmonyImportSpecifierDependency extends HarmonyImportDependency {
32
34
  constructor(
33
35
  request,
@@ -35,14 +37,14 @@ class HarmonyImportSpecifierDependency extends HarmonyImportDependency {
35
37
  ids,
36
38
  name,
37
39
  range,
38
- strictExportPresence,
40
+ exportPresenceMode,
39
41
  assertions
40
42
  ) {
41
43
  super(request, sourceOrder, assertions);
42
44
  this.ids = ids;
43
45
  this.name = name;
44
46
  this.range = range;
45
- this.strictExportPresence = strictExportPresence;
47
+ this.exportPresenceMode = exportPresenceMode;
46
48
  this.namespaceObjectAsContext = false;
47
49
  this.call = undefined;
48
50
  this.directImport = undefined;
@@ -153,19 +155,29 @@ class HarmonyImportSpecifierDependency extends HarmonyImportDependency {
153
155
  return [ids];
154
156
  }
155
157
 
158
+ /**
159
+ * @param {ModuleGraph} moduleGraph module graph
160
+ * @returns {number} effective mode
161
+ */
162
+ _getEffectiveExportPresenceLevel(moduleGraph) {
163
+ if (this.exportPresenceMode !== ExportPresenceModes.AUTO)
164
+ return this.exportPresenceMode;
165
+ return moduleGraph.getParentModule(this).buildMeta.strictHarmonyModule
166
+ ? ExportPresenceModes.ERROR
167
+ : ExportPresenceModes.WARN;
168
+ }
169
+
156
170
  /**
157
171
  * Returns warnings
158
172
  * @param {ModuleGraph} moduleGraph module graph
159
173
  * @returns {WebpackError[]} warnings
160
174
  */
161
175
  getWarnings(moduleGraph) {
162
- if (
163
- this.strictExportPresence ||
164
- moduleGraph.getParentModule(this).buildMeta.strictHarmonyModule
165
- ) {
166
- return null;
176
+ const exportPresence = this._getEffectiveExportPresenceLevel(moduleGraph);
177
+ if (exportPresence === ExportPresenceModes.WARN) {
178
+ return this._getErrors(moduleGraph);
167
179
  }
168
- return this._getErrors(moduleGraph);
180
+ return null;
169
181
  }
170
182
 
171
183
  /**
@@ -174,10 +186,8 @@ class HarmonyImportSpecifierDependency extends HarmonyImportDependency {
174
186
  * @returns {WebpackError[]} errors
175
187
  */
176
188
  getErrors(moduleGraph) {
177
- if (
178
- this.strictExportPresence ||
179
- moduleGraph.getParentModule(this).buildMeta.strictHarmonyModule
180
- ) {
189
+ const exportPresence = this._getEffectiveExportPresenceLevel(moduleGraph);
190
+ if (exportPresence === ExportPresenceModes.ERROR) {
181
191
  return this._getErrors(moduleGraph);
182
192
  }
183
193
  return null;
@@ -209,7 +219,7 @@ class HarmonyImportSpecifierDependency extends HarmonyImportDependency {
209
219
  write(this.ids);
210
220
  write(this.name);
211
221
  write(this.range);
212
- write(this.strictExportPresence);
222
+ write(this.exportPresenceMode);
213
223
  write(this.namespaceObjectAsContext);
214
224
  write(this.call);
215
225
  write(this.directImport);
@@ -224,7 +234,7 @@ class HarmonyImportSpecifierDependency extends HarmonyImportDependency {
224
234
  this.ids = read();
225
235
  this.name = read();
226
236
  this.range = read();
227
- this.strictExportPresence = read();
237
+ this.exportPresenceMode = read();
228
238
  this.namespaceObjectAsContext = read();
229
239
  this.call = read();
230
240
  this.directImport = read();
@@ -85,14 +85,14 @@ RequireEnsureDependency.Template = class RequireEnsureDependencyTemplate extends
85
85
  source.replace(
86
86
  contentRange[1],
87
87
  errorHandlerRange[0] - 1,
88
- ").bind(null, __webpack_require__)).catch("
88
+ ").bind(null, __webpack_require__))['catch']("
89
89
  );
90
90
  source.replace(errorHandlerRange[1], range[1] - 1, ")");
91
91
  } else {
92
92
  source.replace(
93
93
  contentRange[1],
94
94
  range[1] - 1,
95
- `).bind(null, __webpack_require__)).catch(${RuntimeGlobals.uncaughtErrorHandler})`
95
+ `).bind(null, __webpack_require__))['catch'](${RuntimeGlobals.uncaughtErrorHandler})`
96
96
  );
97
97
  }
98
98
  }
@@ -41,7 +41,12 @@ module.exports = options => (compiler, callback) => {
41
41
  const listen =
42
42
  typeof options.listen === "function"
43
43
  ? options.listen
44
- : server => server.listen(options.listen);
44
+ : server => {
45
+ let listen = options.listen;
46
+ if (typeof listen === "object" && !("port" in listen))
47
+ listen = { ...listen, port: undefined };
48
+ server.listen(listen);
49
+ };
45
50
 
46
51
  const protocol = options.protocol || (isHttps ? "https" : "http");
47
52
 
@@ -211,7 +211,7 @@ class RequireChunkLoadingRuntimeModule extends RuntimeModule {
211
211
  RuntimeGlobals.getUpdateManifestFilename
212
212
  }());`
213
213
  ]),
214
- '}).catch(function(err) { if(err.code !== "MODULE_NOT_FOUND") throw err; });'
214
+ "})['catch'](function(err) { if(err.code !== 'MODULE_NOT_FOUND') throw err; });"
215
215
  ]),
216
216
  "}"
217
217
  ])
@@ -56,6 +56,7 @@ class ModuleConcatenationPlugin {
56
56
  * @returns {void}
57
57
  */
58
58
  apply(compiler) {
59
+ const { _backCompat: backCompat } = compiler;
59
60
  compiler.hooks.compilation.tap("ModuleConcatenationPlugin", compilation => {
60
61
  const moduleGraph = compilation.moduleGraph;
61
62
  const bailoutReasonMap = new Map();
@@ -389,8 +390,10 @@ class ModuleConcatenationPlugin {
389
390
  };
390
391
 
391
392
  const integrate = () => {
392
- ChunkGraph.setChunkGraphForModule(newModule, chunkGraph);
393
- ModuleGraph.setModuleGraphForModule(newModule, moduleGraph);
393
+ if (backCompat) {
394
+ ChunkGraph.setChunkGraphForModule(newModule, chunkGraph);
395
+ ModuleGraph.setModuleGraphForModule(newModule, moduleGraph);
396
+ }
394
397
 
395
398
  for (const warning of concatConfiguration.getWarningsSorted()) {
396
399
  moduleGraph
@@ -102,6 +102,7 @@ const MinMaxSizeWarning = require("./MinMaxSizeWarning");
102
102
 
103
103
  /**
104
104
  * @typedef {Object} FallbackCacheGroup
105
+ * @property {ChunkFilterFunction} chunksFilter
105
106
  * @property {SplitChunksSizes} minSize
106
107
  * @property {SplitChunksSizes} maxAsyncSize
107
108
  * @property {SplitChunksSizes} maxInitialSize
@@ -658,6 +659,9 @@ module.exports = class SplitChunksPlugin {
658
659
  automaticNameDelimiter: options.automaticNameDelimiter,
659
660
  usedExports: options.usedExports,
660
661
  fallbackCacheGroup: {
662
+ chunksFilter: normalizeChunksFilter(
663
+ fallbackCacheGroup.chunks || options.chunks || "all"
664
+ ),
661
665
  minSize: mergeSizes(
662
666
  normalizeSizes(fallbackCacheGroup.minSize, defaultSizeTypes),
663
667
  minSize
@@ -1598,6 +1602,7 @@ module.exports = class SplitChunksPlugin {
1598
1602
  const { outputOptions } = compilation;
1599
1603
 
1600
1604
  // Make sure that maxSize is fulfilled
1605
+ const { fallbackCacheGroup } = this.options;
1601
1606
  for (const chunk of Array.from(compilation.chunks)) {
1602
1607
  const chunkConfig = maxSizeQueueMap.get(chunk);
1603
1608
  const {
@@ -1605,7 +1610,9 @@ module.exports = class SplitChunksPlugin {
1605
1610
  maxAsyncSize,
1606
1611
  maxInitialSize,
1607
1612
  automaticNameDelimiter
1608
- } = chunkConfig || this.options.fallbackCacheGroup;
1613
+ } = chunkConfig || fallbackCacheGroup;
1614
+ if (!chunkConfig && !fallbackCacheGroup.chunksFilter(chunk))
1615
+ continue;
1609
1616
  /** @type {SplitChunksSizes} */
1610
1617
  let maxSize;
1611
1618
  if (chunk.isOnlyInitial()) {
@@ -59,7 +59,7 @@ class AsyncModuleRuntimeModule extends HelperRuntimeModule {
59
59
  ])});`,
60
60
  `var obj = {};
61
61
  obj[webpackThen] = ${runtimeTemplate.expressionFunction(
62
- "queueFunction(queue, fn), dep.catch(reject)",
62
+ "queueFunction(queue, fn), dep['catch'](reject)",
63
63
  "fn, reject"
64
64
  )};`,
65
65
  "return obj;"
@@ -114,7 +114,7 @@ class AsyncModuleRuntimeModule extends HelperRuntimeModule {
114
114
  "if (isEvaluating) { return completeFunction(fn); }",
115
115
  "if (currentDeps) whenAll(currentDeps, fn, rejectFn);",
116
116
  "queueFunction(queue, fn);",
117
- "promise.catch(rejectFn);"
117
+ "promise['catch'](rejectFn);"
118
118
  ]
119
119
  )};`,
120
120
  "module.exports = promise;",
@@ -320,7 +320,7 @@ class ConsumeSharedRuntimeModule extends RuntimeModule {
320
320
  "var promise = moduleToHandlerMapping[id]();",
321
321
  "if(promise.then) {",
322
322
  Template.indent(
323
- `promises.push(installedModules[id] = promise.then(onFactory).catch(onError));`
323
+ "promises.push(installedModules[id] = promise.then(onFactory)['catch'](onError));"
324
324
  ),
325
325
  "} else onFactory(promise);"
326
326
  ]),
@@ -105,7 +105,7 @@ class ShareRuntimeModule extends RuntimeModule {
105
105
  )}`,
106
106
  "if(module.then) return promises.push(module.then(initFn, handleError));",
107
107
  "var initResult = initFn(module);",
108
- "if(initResult && initResult.then) return promises.push(initResult.catch(handleError));"
108
+ "if(initResult && initResult.then) return promises.push(initResult['catch'](handleError));"
109
109
  ]),
110
110
  "} catch(err) { handleError(err); }"
111
111
  ])}`,
@@ -165,8 +165,16 @@ exports.arrayToSetDeprecation = (set, name) => {
165
165
  };
166
166
 
167
167
  exports.createArrayToSetDeprecationSet = name => {
168
- class SetDeprecatedArray extends Set {}
169
- exports.arrayToSetDeprecation(SetDeprecatedArray.prototype, name);
168
+ let initialized = false;
169
+ class SetDeprecatedArray extends Set {
170
+ constructor(items) {
171
+ super(items);
172
+ if (!initialized) {
173
+ initialized = true;
174
+ exports.arrayToSetDeprecation(SetDeprecatedArray.prototype, name);
175
+ }
176
+ }
177
+ }
170
178
  return SetDeprecatedArray;
171
179
  };
172
180
 
@@ -36,7 +36,11 @@ class BatchedHash extends Hash {
36
36
  this.string = undefined;
37
37
  }
38
38
  if (typeof data === "string") {
39
- if (data.length < MAX_SHORT_STRING) {
39
+ if (
40
+ data.length < MAX_SHORT_STRING &&
41
+ // base64 encoding is not valid since it may contain padding chars
42
+ (!inputEncoding || !inputEncoding.startsWith("ba"))
43
+ ) {
40
44
  this.string = data;
41
45
  this.encoding = inputEncoding;
42
46
  } else {
@@ -72,7 +72,7 @@ class WasmHash {
72
72
  endPos += 2;
73
73
  } else {
74
74
  // bail-out for weird chars
75
- endPos += mem.write(data.slice(endPos), endPos, encoding);
75
+ endPos += mem.write(data.slice(i), endPos, encoding);
76
76
  break;
77
77
  }
78
78
  }
package/lib/webpack.js CHANGED
@@ -61,8 +61,7 @@ const createMultiCompiler = (childOptions, options) => {
61
61
  const createCompiler = rawOptions => {
62
62
  const options = getNormalizedWebpackOptions(rawOptions);
63
63
  applyWebpackOptionsBaseDefaults(options);
64
- const compiler = new Compiler(options.context);
65
- compiler.options = options;
64
+ const compiler = new Compiler(options.context, options);
66
65
  new NodeEnvironmentPlugin({
67
66
  infrastructureLogging: options.infrastructureLogging
68
67
  }).apply(compiler);
package/module.d.ts ADDED
@@ -0,0 +1,200 @@
1
+ declare namespace webpack {
2
+ type HotEvent =
3
+ | {
4
+ type: "disposed";
5
+ /** The module in question. */
6
+ moduleId: number;
7
+ }
8
+ | {
9
+ type: "self-declined" | "unaccepted";
10
+ /** The module in question. */
11
+ moduleId: number;
12
+ /** the chain from where the update was propagated. */
13
+ chain: number[];
14
+ }
15
+ | {
16
+ type: "declined";
17
+ /** The module in question. */
18
+ moduleId: number;
19
+ /** the chain from where the update was propagated. */
20
+ chain: number[];
21
+ /** the module id of the declining parent */
22
+ parentId: number;
23
+ }
24
+ | {
25
+ type: "accepted";
26
+ /** The module in question. */
27
+ moduleId: number;
28
+ /** the chain from where the update was propagated. */
29
+ chain: number[];
30
+ /** the modules that are outdated and will be disposed */
31
+ outdatedModules: number[];
32
+ /** the accepted dependencies that are outdated */
33
+ outdatedDependencies: {
34
+ [id: number]: number[];
35
+ };
36
+ }
37
+ | {
38
+ type: "accept-error-handler-errored";
39
+ /** The module in question. */
40
+ moduleId: number;
41
+ /** the module id owning the accept handler. */
42
+ dependencyId: number;
43
+ /** the thrown error */
44
+ error: Error;
45
+ /** the error thrown by the module before the error handler tried to handle it. */
46
+ originalError: Error;
47
+ }
48
+ | {
49
+ type: "self-accept-error-handler-errored";
50
+ /** The module in question. */
51
+ moduleId: number;
52
+ /** the thrown error */
53
+ error: Error;
54
+ /** the error thrown by the module before the error handler tried to handle it. */
55
+ originalError: Error;
56
+ }
57
+ | {
58
+ type: "accept-errored";
59
+ /** The module in question. */
60
+ moduleId: number;
61
+ /** the module id owning the accept handler. */
62
+ dependencyId: number;
63
+ /** the thrown error */
64
+ error: Error;
65
+ }
66
+ | {
67
+ type: "self-accept-errored";
68
+ /** The module in question. */
69
+ moduleId: number;
70
+ /** the thrown error */
71
+ error: Error;
72
+ };
73
+
74
+ interface ApplyOptions {
75
+ ignoreUnaccepted?: boolean;
76
+ ignoreDeclined?: boolean;
77
+ ignoreErrored?: boolean;
78
+ onDeclined?(callback: (info: HotEvent) => void): void;
79
+ onUnaccepted?(callback: (info: HotEvent) => void): void;
80
+ onAccepted?(callback: (info: HotEvent) => void): void;
81
+ onDisposed?(callback: (info: HotEvent) => void): void;
82
+ onErrored?(callback: (info: HotEvent) => void): void;
83
+ }
84
+
85
+ const enum HotUpdateStatus {
86
+ idle = "idle",
87
+ check = "check",
88
+ prepare = "prepare",
89
+ ready = "ready",
90
+ dispose = "dispose",
91
+ apply = "apply",
92
+ abort = "abort",
93
+ fail = "fail"
94
+ }
95
+
96
+ interface Hot {
97
+ accept: {
98
+ (
99
+ modules: string | string[],
100
+ callback?: (outdatedDependencies: string[]) => void,
101
+ errorHandler?: (
102
+ err: Error,
103
+ context: { moduleId: string | number; dependencyId: string | number }
104
+ ) => void
105
+ ): void;
106
+ (
107
+ errorHandler: (
108
+ err: Error,
109
+ ids: { moduleId: string | number; module: NodeJS.Module }
110
+ ) => void
111
+ ): void;
112
+ };
113
+ status(): HotUpdateStatus;
114
+ decline(module?: string | string[]): void;
115
+ dispose(callback: (data: object) => void): void;
116
+ addDisposeHandler(callback: (data: object) => void): void;
117
+ removeDisposeHandler(callback: (data: object) => void): void;
118
+ invalidate(): void;
119
+ addStatusHandler(callback: (status: HotUpdateStatus) => void): void;
120
+ removeStatusHandler(callback: (status: HotUpdateStatus) => void): void;
121
+ data: object;
122
+ check(
123
+ autoApply?: boolean | ApplyOptions
124
+ ): Promise<(string | number)[] | null>;
125
+ apply(options?: ApplyOptions): Promise<(string | number)[] | null>;
126
+ }
127
+
128
+ interface ExportInfo {
129
+ used: boolean;
130
+ provideInfo: boolean | null | undefined;
131
+ useInfo: boolean | null | undefined;
132
+ }
133
+
134
+ interface ExportsInfo {
135
+ [k: string]: ExportInfo & ExportsInfo;
136
+ }
137
+
138
+ interface Context {
139
+ resolve(dependency: string): string | number;
140
+ keys(): Array<string>;
141
+ id: string | number;
142
+ (dependency: string): unknown;
143
+ }
144
+ }
145
+
146
+ interface ImportMeta {
147
+ url: string;
148
+ webpack: number;
149
+ webpackHot: webpack.Hot;
150
+ }
151
+
152
+ declare const __resourceQuery: string;
153
+ declare var __webpack_public_path__: string;
154
+ declare var __webpack_nonce__: string;
155
+ declare const __webpack_chunkname__: string;
156
+ declare var __webpack_base_uri__: string;
157
+ declare var __webpack_runtime_id__: string;
158
+ declare const __webpack_hash__: string;
159
+ declare const __webpack_modules__: Record<string | number, NodeJS.Module>;
160
+ declare const __webpack_require__: (id: string | number) => unknown;
161
+ declare var __webpack_chunk_load__: (chunkId: string | number) => Promise<void>;
162
+ declare var __webpack_get_script_filename__: (
163
+ chunkId: string | number
164
+ ) => string;
165
+ declare var __webpack_is_included__: (request: string) => boolean;
166
+ declare var __webpack_exports_info__: webpack.ExportsInfo;
167
+ declare const __webpack_share_scopes__: Record<
168
+ string,
169
+ Record<
170
+ string,
171
+ { loaded?: 1; get: () => Promise<unknown>; from: string; eager: boolean }
172
+ >
173
+ >;
174
+ declare var __webpack_init_sharing__: (scope: string) => Promise<void>;
175
+ declare var __non_webpack_require__: (id: any) => unknown;
176
+ declare const __system_context__: object;
177
+
178
+ declare namespace NodeJS {
179
+ interface Module {
180
+ hot: webpack.Hot;
181
+ }
182
+
183
+ interface Require {
184
+ ensure(
185
+ dependencies: string[],
186
+ callback: (require: (module: string) => void) => void,
187
+ errorCallback?: (error: Error) => void,
188
+ chunkName?: string
189
+ ): void;
190
+ context(
191
+ request: string,
192
+ includeSubdirectories?: boolean,
193
+ filter?: RegExp,
194
+ mode?: "sync" | "eager" | "weak" | "lazy" | "lazy-once"
195
+ ): webpack.Context;
196
+ include(dependency: string): void;
197
+ resolveWeak(dependency: string): void;
198
+ onError?: (error: Error) => void;
199
+ }
200
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webpack",
3
- "version": "5.61.0",
3
+ "version": "5.62.0",
4
4
  "author": "Tobias Koppers @sokra",
5
5
  "description": "Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.",
6
6
  "license": "MIT",
@@ -39,7 +39,7 @@
39
39
  "@babel/core": "^7.11.1",
40
40
  "@babel/preset-react": "^7.10.4",
41
41
  "@types/es-module-lexer": "^0.4.1",
42
- "@types/jest": "^27.0.1",
42
+ "@types/jest": "^27.0.2",
43
43
  "@types/node": "^15.0.1",
44
44
  "assemblyscript": "^0.19.16",
45
45
  "babel-loader": "^8.1.0",
@@ -66,11 +66,11 @@
66
66
  "husky": "^6.0.0",
67
67
  "is-ci": "^3.0.0",
68
68
  "istanbul": "^0.4.5",
69
- "jest": "^27.0.6",
70
- "jest-circus": "^27.0.6",
71
- "jest-cli": "^27.0.6",
72
- "jest-diff": "^27.0.2",
73
- "jest-junit": "^12.0.0",
69
+ "jest": "^27.3.1",
70
+ "jest-circus": "^27.3.1",
71
+ "jest-cli": "^27.3.1",
72
+ "jest-diff": "^27.3.1",
73
+ "jest-junit": "^13.0.0",
74
74
  "json-loader": "^0.5.7",
75
75
  "json5": "^2.1.3",
76
76
  "less": "^4.0.0",
@@ -132,6 +132,7 @@
132
132
  "hot/",
133
133
  "schemas/",
134
134
  "SECURITY.md",
135
+ "module.d.ts",
135
136
  "types.d.ts"
136
137
  ],
137
138
  "scripts": {
@@ -153,17 +154,18 @@
153
154
  "type-report": "rimraf coverage && yarn cover:types && yarn cover:report && open-cli coverage/lcov-report/index.html",
154
155
  "pretest": "yarn lint",
155
156
  "prelint": "yarn setup",
156
- "lint": "yarn code-lint && yarn special-lint && yarn type-lint && yarn typings-lint && yarn yarn-lint && yarn pretty-lint && yarn spellcheck",
157
+ "lint": "yarn code-lint && yarn special-lint && yarn type-lint && yarn typings-test && yarn module-typings-test && yarn yarn-lint && yarn pretty-lint && yarn spellcheck",
157
158
  "code-lint": "eslint . --ext '.js' --cache",
158
159
  "type-lint": "tsc",
159
- "typings-lint": "tsc -p tsconfig.test.json",
160
+ "typings-test": "tsc -p tsconfig.types.test.json",
161
+ "module-typings-test": "tsc -p tsconfig.module.test.json",
160
162
  "spellcheck": "cspell \"{.github,benchmark,bin,examples,hot,lib,schemas,setup,tooling}/**/*.{md,yml,yaml,js,json}\" \"*.md\"",
161
163
  "special-lint": "node node_modules/tooling/lockfile-lint && node node_modules/tooling/schemas-lint && node node_modules/tooling/inherit-types && node node_modules/tooling/format-schemas && node tooling/generate-runtime-code.js && node tooling/generate-wasm-code.js && node node_modules/tooling/format-file-header && node node_modules/tooling/compile-to-definitions && node node_modules/tooling/precompile-schemas && node node_modules/tooling/generate-types --no-template-literals",
162
164
  "special-lint-fix": "node node_modules/tooling/inherit-types --write && node node_modules/tooling/format-schemas --write && node tooling/generate-runtime-code.js --write && node tooling/generate-wasm-code.js --write && node node_modules/tooling/format-file-header --write && node node_modules/tooling/compile-to-definitions --write && node node_modules/tooling/precompile-schemas --write && node node_modules/tooling/generate-types --no-template-literals --write",
163
165
  "fix": "yarn code-lint --fix && yarn special-lint-fix && yarn pretty-lint-fix",
164
166
  "prepare": "husky install",
165
167
  "pretty-lint-base": "prettier \"*.{ts,json,yml,yaml,md}\" \"{setup,lib,bin,hot,benchmark,tooling,schemas}/**/*.json\" \"examples/*.md\"",
166
- "pretty-lint-base-all": "yarn pretty-lint-base \"*.js\" \"{setup,lib,bin,hot,benchmark,tooling,schemas}/**/*.js\" \"test/*.js\" \"test/helpers/*.js\" \"test/{configCases,watchCases,statsCases,hotCases,benchmarkCases}/**/webpack.config.js\" \"examples/**/webpack.config.js\"",
168
+ "pretty-lint-base-all": "yarn pretty-lint-base \"*.js\" \"{setup,lib,bin,hot,benchmark,tooling,schemas}/**/*.js\" \"module.d.ts\" \"test/*.js\" \"test/helpers/*.js\" \"test/{configCases,watchCases,statsCases,hotCases,benchmarkCases}/**/webpack.config.js\" \"examples/**/webpack.config.js\"",
167
169
  "pretty-lint-fix": "yarn pretty-lint-base-all --loglevel warn --write",
168
170
  "pretty-lint": "yarn pretty-lint-base --check",
169
171
  "yarn-lint": "yarn-deduplicate --fail --list -s highest yarn.lock",