webpack 5.76.2 → 5.76.3

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.

package/bin/webpack.js CHANGED
@@ -53,6 +53,19 @@ const isInstalled = packageName => {
53
53
  }
54
54
  } while (dir !== (dir = path.dirname(dir)));
55
55
 
56
+ // https://github.com/nodejs/node/blob/v18.9.1/lib/internal/modules/cjs/loader.js#L1274
57
+ // eslint-disable-next-line no-warning-comments
58
+ // @ts-ignore
59
+ for (const internalPath of require("module").globalPaths) {
60
+ try {
61
+ if (fs.statSync(path.join(internalPath, packageName)).isDirectory()) {
62
+ return true;
63
+ }
64
+ } catch (_error) {
65
+ // Nothing
66
+ }
67
+ }
68
+
56
69
  return false;
57
70
  };
58
71
 
@@ -162,6 +162,7 @@ ModuleFilenameHelpers.createFilename = (
162
162
  resource: resource,
163
163
  resourcePath: memoize(resourcePath),
164
164
  absoluteResourcePath: memoize(absoluteResourcePath),
165
+ loaders: memoize(loaders),
165
166
  allLoaders: memoize(allLoaders),
166
167
  query: memoize(query),
167
168
  moduleId: memoize(moduleId),
@@ -841,10 +841,10 @@ class NormalModuleFactory extends ModuleFactory {
841
841
  (err2, hints) => {
842
842
  if (err2) {
843
843
  err.message += `
844
- An fatal error happened during resolving additional hints for this error: ${err2.message}`;
844
+ A fatal error happened during resolving additional hints for this error: ${err2.message}`;
845
845
  err.stack += `
846
846
 
847
- An fatal error happened during resolving additional hints for this error:
847
+ A fatal error happened during resolving additional hints for this error:
848
848
  ${err2.stack}`;
849
849
  return callback(err);
850
850
  }
@@ -64,7 +64,9 @@ class ContainerPlugin {
64
64
  const { name, exposes, shareScope, filename, library, runtime } =
65
65
  this._options;
66
66
 
67
- compiler.options.output.enabledLibraryTypes.push(library.type);
67
+ if (!compiler.options.output.enabledLibraryTypes.includes(library.type)) {
68
+ compiler.options.output.enabledLibraryTypes.push(library.type);
69
+ }
68
70
 
69
71
  compiler.hooks.make.tapAsync(PLUGIN_NAME, (compilation, callback) => {
70
72
  const dep = new ContainerEntryDependency(name, exposes, shareScope);
@@ -11,6 +11,7 @@ const HotUpdateChunk = require("../HotUpdateChunk");
11
11
  const Template = require("../Template");
12
12
  const { getAllChunks } = require("../javascript/ChunkHelpers");
13
13
  const {
14
+ chunkHasJs,
14
15
  getCompilationHooks,
15
16
  getChunkFilenameTemplate
16
17
  } = require("../javascript/JavascriptModulesPlugin");
@@ -147,7 +148,11 @@ class ModuleChunkFormatPlugin {
147
148
  undefined
148
149
  );
149
150
  for (const chunk of chunks) {
150
- if (loadedChunks.has(chunk)) continue;
151
+ if (
152
+ loadedChunks.has(chunk) ||
153
+ !chunkHasJs(chunk, chunkGraph)
154
+ )
155
+ continue;
151
156
  loadedChunks.add(chunk);
152
157
  startupSource.add(
153
158
  `import * as __webpack_chunk_${index}__ from ${JSON.stringify(
@@ -31,6 +31,7 @@ const builtins = [
31
31
  "http2",
32
32
  "https",
33
33
  "inspector",
34
+ "inspector/promises",
34
35
  "module",
35
36
  "net",
36
37
  "os",
@@ -42,8 +43,10 @@ const builtins = [
42
43
  "punycode",
43
44
  "querystring",
44
45
  "readline",
46
+ "readline/promises",
45
47
  "repl",
46
48
  "stream",
49
+ "stream/consumers",
47
50
  "stream/promises",
48
51
  "stream/web",
49
52
  "string_decoder",
@@ -38,10 +38,8 @@ module.exports = ({ colors, appendOnly, stream }) => {
38
38
 
39
39
  const writeStatusMessage = () => {
40
40
  if (!currentStatusMessage) return;
41
- const l = stream.columns;
42
- const args = l
43
- ? truncateArgs(currentStatusMessage, l - 1)
44
- : currentStatusMessage;
41
+ const l = stream.columns || 40;
42
+ const args = truncateArgs(currentStatusMessage, l - 1);
45
43
  const str = args.join(" ");
46
44
  const coloredStr = `\u001b[1m${str}\u001b[39m\u001b[22m`;
47
45
  stream.write(`\x1b[2K\r${coloredStr}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webpack",
3
- "version": "5.76.2",
3
+ "version": "5.76.3",
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",