You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test: update target flag tests for webpack 5.108 (#4797)
webpack 5.108 introduces the universal, deno and bun targets and
supports combining targets like node and web via universal ESM
output, which broke the target flag tests:
- update the "Unknown target" stderr snapshots to include the new
universal, deno and bun entries
- replace the "should throw an error for incompatible multiple
targets" test with "should allow multiple different targets",
since node + web now builds successfully
- bump webpack to 5.108.3 in the lockfile so the snapshots match
the installed version
Fixes the failing CI on #4792 and unblocks #4795.
Claude-Session: https://claude.ai/code/session_012iKSSr35Ue6UtyA6rcw6UA
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: test/build/target/flag-test/__snapshots__/target-flag.test.js.snap.webpack5
+6-11Lines changed: 6 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -4,23 +4,15 @@ exports[`--target flag should reset the \`target\` option when the \`--target-re
4
4
5
5
exports[`--target flag should reset the \`target\` option when the \`--target-reset\` is used: stderr 1`] = `""`;
6
6
7
-
exports[`--target flag should throw an error for incompatible multiple targets: stderr 1`] = `
8
-
"[webpack-cli] ✖ Error: For the selected environment is no default script chunk format available:
9
-
10
-
JSONP Array push ('array-push') can be chosen when 'document' or 'importScripts' is available.
11
-
CommonJs exports ('commonjs') can be chosen when 'require' or node builtins are available.
12
-
Select an appropriate 'target' to allow selecting one by default, or specify the 'output.chunkFormat' directly.
13
-
at stack"
14
-
`;
15
-
16
-
exports[`--target flag should throw an error for incompatible multiple targets: stdout 1`] = `""`;
17
-
18
7
exports[`--target flag should throw an error for invalid target in multiple syntax: stderr 1`] = `
19
8
"[webpack-cli] ✖ Error: Unknown target 'invalid'. The following targets are supported:
20
9
* browserslist / browserslist:env / browserslist:query / browserslist:path-to-config / browserslist:path-to-config:env: Resolve features from browserslist. Will resolve browserslist config automatically. Only browser or node queries are supported (electron is not supported). Examples: 'browserslist:modern' to use 'modern' environment from browserslist config
21
10
* web: Web browser.
22
11
* webworker: Web Worker, SharedWorker or Service Worker.
12
+
* universal: Universal target running in browser, web worker, Node.js, Electron and NW.js. Output is always ECMAScript modules.
23
13
* [async-]node[X[.Y]]: Node.js in version X.Y. The 'async-' prefix will load chunks asynchronously via 'fs' and 'vm' instead of 'require()'. Examples: node14.5, async-node10.
14
+
* deno[X[.Y]]: Deno in version X.Y. Emits ESM output; node.js built-ins are available via the required 'node:' specifier and web APIs (fetch, WebAssembly, ...) are available too. Examples: deno2, deno1.40.
15
+
* bun[X[.Y]]: Bun in version X.Y. Output is always ECMAScript modules. Examples: bun, bun1.1.
24
16
* electron[X[.Y]]-main/preload/renderer: Electron in version X.Y. Script is running in main, preload resp. renderer context.
25
17
* nwjs[X[.Y]] / node-webkit[X[.Y]]: NW.js in version X.Y.
26
18
* esX: EcmaScript in this version. Examples: es2020, es5.
@@ -41,7 +33,10 @@ exports[`--target flag should throw error with invalid value for --target: stder
41
33
* browserslist / browserslist:env / browserslist:query / browserslist:path-to-config / browserslist:path-to-config:env: Resolve features from browserslist. Will resolve browserslist config automatically. Only browser or node queries are supported (electron is not supported). Examples: 'browserslist:modern' to use 'modern' environment from browserslist config
42
34
* web: Web browser.
43
35
* webworker: Web Worker, SharedWorker or Service Worker.
36
+
* universal: Universal target running in browser, web worker, Node.js, Electron and NW.js. Output is always ECMAScript modules.
44
37
* [async-]node[X[.Y]]: Node.js in version X.Y. The 'async-' prefix will load chunks asynchronously via 'fs' and 'vm' instead of 'require()'. Examples: node14.5, async-node10.
38
+
* deno[X[.Y]]: Deno in version X.Y. Emits ESM output; node.js built-ins are available via the required 'node:' specifier and web APIs (fetch, WebAssembly, ...) are available too. Examples: deno2, deno1.40.
39
+
* bun[X[.Y]]: Bun in version X.Y. Output is always ECMAScript modules. Examples: bun, bun1.1.
45
40
* electron[X[.Y]]-main/preload/renderer: Electron in version X.Y. Script is running in main, preload resp. renderer context.
46
41
* nwjs[X[.Y]] / node-webkit[X[.Y]]: NW.js in version X.Y.
47
42
* esX: EcmaScript in this version. Examples: es2020, es5.
0 commit comments