Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add missing semicolon in AutoPublicPathRuntimeModule #16811

Merged
merged 2 commits into from Mar 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/runtime/AutoPublicPathRuntimeModule.js
Expand Up @@ -43,7 +43,7 @@ class AutoPublicPathRuntimeModule extends RuntimeModule {
"if (!scriptUrl && document) {",
Template.indent([
`if (document.currentScript)`,
Template.indent(`scriptUrl = document.currentScript.src`),
Template.indent(`scriptUrl = document.currentScript.src;`),
"if (!scriptUrl) {",
Template.indent([
'var scripts = document.getElementsByTagName("script");',
Expand Down
80 changes: 40 additions & 40 deletions test/__snapshots__/StatsTestCases.basictest.js.snap
Expand Up @@ -191,9 +191,9 @@ webpack x.x.x compiled successfully in X ms"
`;

exports[`StatsTestCases should print correct stats for async-commons-chunk 1`] = `
"chunk (runtime: main) main.js (main) 515 bytes (javascript) 5.99 KiB (runtime) >{460}< >{847}< >{996}< [entry] [rendered]
"chunk (runtime: main) main.js (main) 515 bytes (javascript) 6 KiB (runtime) >{460}< >{847}< >{996}< [entry] [rendered]
> ./ main
runtime modules 5.99 KiB 7 modules
runtime modules 6 KiB 7 modules
./index.js 515 bytes [built] [code generated]
chunk (runtime: main) 460.js 21 bytes <{179}> ={847}= [rendered]
> ./index.js 17:1-21:3
Expand All @@ -220,9 +220,9 @@ exports[`StatsTestCases should print correct stats for async-commons-chunk-auto
> ./g ./a.js 6:0-47
dependent modules 20 bytes [dependent] 1 module
./g.js 45 bytes [built] [code generated]
chunk (runtime: main) disabled/main.js (main) 147 bytes (javascript) 6.64 KiB (runtime) [entry] [rendered]
chunk (runtime: main) disabled/main.js (main) 147 bytes (javascript) 6.65 KiB (runtime) [entry] [rendered]
> ./ main
runtime modules 6.64 KiB 9 modules
runtime modules 6.65 KiB 9 modules
./index.js 147 bytes [built] [code generated]
chunk (runtime: main) disabled/async-b.js (async-b) 196 bytes [rendered]
> ./b ./index.js 2:0-47
Expand Down Expand Up @@ -290,9 +290,9 @@ default:
chunk (runtime: main) default/769.js (id hint: vendors) 20 bytes [rendered] split chunk (cache group: defaultVendors)
> ./c ./index.js 3:0-47
./node_modules/z.js 20 bytes [built] [code generated]
chunk (runtime: a) default/a.js (a) 245 bytes (javascript) 6.64 KiB (runtime) [entry] [rendered]
chunk (runtime: a) default/a.js (a) 245 bytes (javascript) 6.65 KiB (runtime) [entry] [rendered]
> ./a a
runtime modules 6.64 KiB 9 modules
runtime modules 6.65 KiB 9 modules
dependent modules 60 bytes [dependent] 3 modules
./a.js + 1 modules 185 bytes [built] [code generated]
chunk (runtime: main) default/async-a.js (async-a) 185 bytes [rendered]
Expand Down Expand Up @@ -1298,8 +1298,8 @@ exports[`StatsTestCases should print correct stats for limit-chunk-count-plugin
2 chunks:
asset bundle2.js 12.5 KiB [emitted] (name: main)
asset 459.bundle2.js 664 bytes [emitted] (name: c)
chunk (runtime: main) bundle2.js (main) 101 bytes (javascript) 7.68 KiB (runtime) >{459}< [entry] [rendered]
runtime modules 7.68 KiB 10 modules
chunk (runtime: main) bundle2.js (main) 101 bytes (javascript) 7.69 KiB (runtime) >{459}< [entry] [rendered]
runtime modules 7.69 KiB 10 modules
./index.js 101 bytes [built] [code generated]
chunk (runtime: main) 459.bundle2.js (c) 118 bytes <{179}> <{459}> >{459}< [rendered]
dependent modules 44 bytes [dependent]
Expand All @@ -1314,8 +1314,8 @@ exports[`StatsTestCases should print correct stats for limit-chunk-count-plugin
asset bundle3.js 12.5 KiB [emitted] (name: main)
asset 459.bundle3.js 528 bytes [emitted] (name: c)
asset 524.bundle3.js 206 bytes [emitted]
chunk (runtime: main) bundle3.js (main) 101 bytes (javascript) 7.68 KiB (runtime) >{459}< [entry] [rendered]
runtime modules 7.68 KiB 10 modules
chunk (runtime: main) bundle3.js (main) 101 bytes (javascript) 7.69 KiB (runtime) >{459}< [entry] [rendered]
runtime modules 7.69 KiB 10 modules
./index.js 101 bytes [built] [code generated]
chunk (runtime: main) 459.bundle3.js (c) 74 bytes <{179}> >{524}< [rendered]
./a.js 22 bytes [built] [code generated]
Expand All @@ -1331,8 +1331,8 @@ exports[`StatsTestCases should print correct stats for limit-chunk-count-plugin
asset 459.bundle4.js 392 bytes [emitted] (name: c)
asset 394.bundle4.js 206 bytes [emitted]
asset 524.bundle4.js 206 bytes [emitted]
chunk (runtime: main) bundle4.js (main) 101 bytes (javascript) 7.68 KiB (runtime) >{394}< >{459}< [entry] [rendered]
runtime modules 7.68 KiB 10 modules
chunk (runtime: main) bundle4.js (main) 101 bytes (javascript) 7.69 KiB (runtime) >{394}< >{459}< [entry] [rendered]
runtime modules 7.69 KiB 10 modules
./index.js 101 bytes [built] [code generated]
chunk (runtime: main) 394.bundle4.js 44 bytes <{179}> [rendered]
./a.js 22 bytes [built] [code generated]
Expand Down Expand Up @@ -1494,13 +1494,13 @@ Chunk Group b 549 bytes (21 KiB) = b.js 549 bytes (2.png 21 KiB)
chunk (runtime: main) b.js (b) 67 bytes [rendered]
./node_modules/a/2.png 49 bytes [dependent] [built] [code generated] [1 asset]
./node_modules/b/index.js 18 bytes [built] [code generated]
chunk (runtime: main) main.js (main) 82 bytes (javascript) 6.28 KiB (runtime) [entry] [rendered]
runtime modules 6.28 KiB 8 modules
chunk (runtime: main) main.js (main) 82 bytes (javascript) 6.29 KiB (runtime) [entry] [rendered]
runtime modules 6.29 KiB 8 modules
./index.js 82 bytes [built] [code generated]
chunk (runtime: main) a.js (a) 134 bytes [rendered]
./node_modules/a/2.png 49 bytes [dependent] [built] [code generated] [1 asset]
./node_modules/a/index.js + 1 modules 85 bytes [built] [code generated] [1 asset]
runtime modules 6.28 KiB 8 modules
runtime modules 6.29 KiB 8 modules
orphan modules 49 bytes [orphan] 1 module
modules with assets 234 bytes
modules by path ./node_modules/a/ 134 bytes
Expand Down Expand Up @@ -1695,7 +1695,7 @@ webpack x.x.x compiled with 2 errors in X ms"
`;

exports[`StatsTestCases should print correct stats for named-chunk-groups 1`] = `
"Chunk Group main 11.6 KiB = a-main.js
"Chunk Group main 11.7 KiB = a-main.js
Chunk Group async-a 1.07 KiB = a-52.js 257 bytes a-async-a.js 836 bytes
Chunk Group async-b 1.07 KiB = a-52.js 257 bytes a-async-b.js 836 bytes
Chunk Group async-c 1.45 KiB = a-vendors.js 744 bytes a-async-c.js 741 bytes
Expand All @@ -1722,7 +1722,7 @@ chunk (runtime: main) a-async-a.js (async-a) 175 bytes [rendered]
./a.js 175 bytes [built] [code generated]
webpack x.x.x compiled successfully

Entrypoint main 11.6 KiB = b-main.js
Entrypoint main 11.7 KiB = b-main.js
Chunk Group async-a 1.07 KiB = b-52.js 257 bytes b-async-a.js 836 bytes
Chunk Group async-b 1.07 KiB = b-52.js 257 bytes b-async-b.js 836 bytes
Chunk Group async-c 1.45 KiB = b-vendors.js 744 bytes b-async-c.js 741 bytes
Expand Down Expand Up @@ -1946,7 +1946,7 @@ asset <CLR=32,BOLD>460.js</CLR> 323 bytes <CLR=32,BOLD>[emitted]</CLR>
asset <CLR=32,BOLD>524.js</CLR> 206 bytes <CLR=32,BOLD>[emitted]</CLR>
asset <CLR=32,BOLD>996.js</CLR> 138 bytes <CLR=32,BOLD>[emitted]</CLR>
Entrypoint <CLR=BOLD>main</CLR> 303 KiB = <CLR=32,BOLD>main.js</CLR>
runtime modules 5.99 KiB 7 modules
runtime modules 6 KiB 7 modules
cacheable modules 293 KiB
<CLR=BOLD>./index.js</CLR> 52 bytes <CLR=33,BOLD>[built]</CLR> <CLR=33,BOLD>[code generated]</CLR>
<CLR=BOLD>./a.js</CLR> 293 KiB <CLR=33,BOLD>[built]</CLR> <CLR=33,BOLD>[code generated]</CLR>
Expand All @@ -1963,7 +1963,7 @@ asset <CLR=32,BOLD>460.js</CLR> 323 bytes <CLR=32,BOLD>[emitted]</CLR>
asset <CLR=32,BOLD>524.js</CLR> 206 bytes <CLR=32,BOLD>[emitted]</CLR>
asset <CLR=32,BOLD>996.js</CLR> 138 bytes <CLR=32,BOLD>[emitted]</CLR>
Entrypoint <CLR=BOLD>main</CLR> <CLR=33,BOLD>[big]</CLR> 303 KiB = <CLR=32,BOLD>main.js</CLR>
runtime modules 5.99 KiB 7 modules
runtime modules 6 KiB 7 modules
cacheable modules 293 KiB
<CLR=BOLD>./index.js</CLR> 52 bytes <CLR=33,BOLD>[built]</CLR> <CLR=33,BOLD>[code generated]</CLR>
<CLR=BOLD>./a.js</CLR> 293 KiB <CLR=33,BOLD>[built]</CLR> <CLR=33,BOLD>[code generated]</CLR>
Expand Down Expand Up @@ -2022,7 +2022,7 @@ asset <CLR=32,BOLD>460.js</CLR> 323 bytes <CLR=32,BOLD>[emitted]</CLR>
asset <CLR=32,BOLD>524.js</CLR> 206 bytes <CLR=32,BOLD>[emitted]</CLR>
asset <CLR=32,BOLD>996.js</CLR> 138 bytes <CLR=32,BOLD>[emitted]</CLR>
Entrypoint <CLR=BOLD>main</CLR> <CLR=33,BOLD>[big]</CLR> 303 KiB = <CLR=32,BOLD>main.js</CLR>
runtime modules 5.99 KiB 7 modules
runtime modules 6 KiB 7 modules
cacheable modules 293 KiB
<CLR=BOLD>./index.js</CLR> 52 bytes <CLR=33,BOLD>[built]</CLR> <CLR=33,BOLD>[code generated]</CLR>
<CLR=BOLD>./a.js</CLR> 293 KiB <CLR=33,BOLD>[built]</CLR> <CLR=33,BOLD>[code generated]</CLR>
Expand Down Expand Up @@ -2130,15 +2130,15 @@ asset 460.js 323 bytes {460} [emitted]
asset 524.js 206 bytes {524} [emitted]
asset 996.js 138 bytes {996} [emitted]
Entrypoint main 10.2 KiB = main.js
chunk {179} (runtime: main) main.js (main) 73 bytes (javascript) 5.99 KiB (runtime) >{460}< >{996}< [entry] [rendered]
chunk {179} (runtime: main) main.js (main) 73 bytes (javascript) 6 KiB (runtime) >{460}< >{996}< [entry] [rendered]
> ./index main
chunk {460} (runtime: main) 460.js 54 bytes <{179}> >{524}< [rendered]
> ./c [10] ./index.js 3:0-16
chunk {524} (runtime: main) 524.js 44 bytes <{460}> [rendered]
> [460] ./c.js 1:0-52
chunk {996} (runtime: main) 996.js 22 bytes <{179}> [rendered]
> ./b [10] ./index.js 2:0-16
runtime modules 5.99 KiB
runtime modules 6 KiB
webpack/runtime/ensure chunk 326 bytes {179} [code generated]
[no exports]
[used exports unknown]
Expand All @@ -2157,7 +2157,7 @@ runtime modules 5.99 KiB
webpack/runtime/load script 1.36 KiB {179} [code generated]
[no exports]
[used exports unknown]
webpack/runtime/publicPath 867 bytes {179} [code generated]
webpack/runtime/publicPath 868 bytes {179} [code generated]
[no exports]
[used exports unknown]
cacheable modules 193 bytes
Expand Down Expand Up @@ -2228,7 +2228,7 @@ LOG from webpack.FileSystemInfo
Directory info in cache: 0 timestamps 0 hashes 0 timestamp hash combinations
Managed items info in cache: 0 items

1970-04-20 12:42:42: webpack x.x.x compiled successfully in X ms (440eb519eb0c4246cce1)"
1970-04-20 12:42:42: webpack x.x.x compiled successfully in X ms (44c013196446a1259957)"
`;

exports[`StatsTestCases should print correct stats for preset-errors-only 1`] = `""`;
Expand Down Expand Up @@ -2307,7 +2307,7 @@ asset main.js 10.2 KiB [emitted] (name: main)
asset 460.js 323 bytes [emitted]
asset 524.js 206 bytes [emitted]
asset 996.js 138 bytes [emitted]
runtime modules 5.99 KiB 7 modules
runtime modules 6 KiB 7 modules
cacheable modules 193 bytes
./index.js 51 bytes [built] [code generated]
./a.js 22 bytes [built] [code generated]
Expand All @@ -2330,7 +2330,7 @@ exports[`StatsTestCases should print correct stats for preset-normal-performance
asset <CLR=32,BOLD>460.js</CLR> 323 bytes <CLR=32,BOLD>[emitted]</CLR>
asset <CLR=32,BOLD>524.js</CLR> 206 bytes <CLR=32,BOLD>[emitted]</CLR>
asset <CLR=32,BOLD>996.js</CLR> 138 bytes <CLR=32,BOLD>[emitted]</CLR>
runtime modules 5.99 KiB 7 modules
runtime modules 6 KiB 7 modules
cacheable modules 293 KiB
<CLR=BOLD>./index.js</CLR> 52 bytes <CLR=33,BOLD>[built]</CLR> <CLR=33,BOLD>[code generated]</CLR>
<CLR=BOLD>./a.js</CLR> 293 KiB <CLR=33,BOLD>[built]</CLR> <CLR=33,BOLD>[code generated]</CLR>
Expand Down Expand Up @@ -2358,7 +2358,7 @@ exports[`StatsTestCases should print correct stats for preset-normal-performance
asset <CLR=32,BOLD>460.js</CLR> 355 bytes <CLR=32,BOLD>[emitted]</CLR> 1 related asset
asset <CLR=32,BOLD>524.js</CLR> 238 bytes <CLR=32,BOLD>[emitted]</CLR> 1 related asset
asset <CLR=32,BOLD>996.js</CLR> 170 bytes <CLR=32,BOLD>[emitted]</CLR> 1 related asset
runtime modules 5.99 KiB 7 modules
runtime modules 6 KiB 7 modules
cacheable modules 293 KiB
<CLR=BOLD>./index.js</CLR> 52 bytes <CLR=33,BOLD>[built]</CLR> <CLR=33,BOLD>[code generated]</CLR>
<CLR=BOLD>./a.js</CLR> 293 KiB <CLR=33,BOLD>[built]</CLR> <CLR=33,BOLD>[code generated]</CLR>
Expand Down Expand Up @@ -2406,9 +2406,9 @@ asset 460.js 323 bytes {460} [emitted]
asset 524.js 206 bytes {524} [emitted]
asset 996.js 138 bytes {996} [emitted]
Entrypoint main 10.2 KiB = main.js
chunk {179} (runtime: main) main.js (main) 73 bytes (javascript) 5.99 KiB (runtime) >{460}< >{996}< [entry] [rendered]
chunk {179} (runtime: main) main.js (main) 73 bytes (javascript) 6 KiB (runtime) >{460}< >{996}< [entry] [rendered]
> ./index main
runtime modules 5.99 KiB
runtime modules 6 KiB
webpack/runtime/ensure chunk 326 bytes {179} [code generated]
[no exports]
[used exports unknown]
Expand All @@ -2427,7 +2427,7 @@ chunk {179} (runtime: main) main.js (main) 73 bytes (javascript) 5.99 KiB (runti
webpack/runtime/load script 1.36 KiB {179} [code generated]
[no exports]
[used exports unknown]
webpack/runtime/publicPath 867 bytes {179} [code generated]
webpack/runtime/publicPath 868 bytes {179} [code generated]
[no exports]
[used exports unknown]
cacheable modules 73 bytes
Expand Down Expand Up @@ -2604,7 +2604,7 @@ LOG from webpack.FileSystemInfo
Directory info in cache: 0 timestamps 0 hashes 0 timestamp hash combinations
Managed items info in cache: 0 items

1970-04-20 12:42:42: webpack x.x.x compiled successfully in X ms (440eb519eb0c4246cce1)"
1970-04-20 12:42:42: webpack x.x.x compiled successfully in X ms (44c013196446a1259957)"
`;

exports[`StatsTestCases should print correct stats for real-content-hash 1`] = `
Expand Down Expand Up @@ -3030,15 +3030,15 @@ exports[`StatsTestCases should print correct stats for runtime-specific-used-exp
production (webpack x.x.x) compiled successfully in X ms

development:
asset development-a.js 15.8 KiB [emitted] (name: a)
asset development-b.js 15.8 KiB [emitted] (name: b)
asset development-a.js 15.9 KiB [emitted] (name: a)
asset development-b.js 15.9 KiB [emitted] (name: b)
asset development-dw_js.js 2.11 KiB [emitted]
asset development-dx_js.js 2.11 KiB [emitted]
asset development-dy_js.js 2.11 KiB [emitted]
asset development-dz_js.js 2.11 KiB [emitted]
asset development-c.js 1.13 KiB [emitted] (name: c)
chunk (runtime: a) development-a.js (a) 605 bytes (javascript) 6.57 KiB (runtime) [entry] [rendered]
runtime modules 6.57 KiB 9 modules
chunk (runtime: a) development-a.js (a) 605 bytes (javascript) 6.58 KiB (runtime) [entry] [rendered]
runtime modules 6.58 KiB 9 modules
cacheable modules 605 bytes
./a.js 261 bytes [built] [code generated]
[used exports unknown]
Expand All @@ -3050,8 +3050,8 @@ development:
[used exports unknown]
./reexport.js 37 bytes [dependent] [built] [code generated]
[used exports unknown]
chunk (runtime: b) development-b.js (b) 605 bytes (javascript) 6.57 KiB (runtime) [entry] [rendered]
runtime modules 6.57 KiB 9 modules
chunk (runtime: b) development-b.js (b) 605 bytes (javascript) 6.58 KiB (runtime) [entry] [rendered]
runtime modules 6.58 KiB 9 modules
cacheable modules 605 bytes
./b.js 261 bytes [built] [code generated]
[used exports unknown]
Expand Down Expand Up @@ -3086,7 +3086,7 @@ development:
[used exports unknown]
./module.js?chunk 122 bytes [dependent] [built] [code generated]
[used exports unknown]
runtime modules 13.1 KiB 18 modules
runtime modules 13.2 KiB 18 modules
cacheable modules 1.15 KiB
./a.js 261 bytes [built] [code generated]
[used exports unknown]
Expand Down Expand Up @@ -3495,9 +3495,9 @@ exports[`StatsTestCases should print correct stats for split-chunks 1`] = `
chunk (runtime: main) default/769.js (id hint: vendors) 20 bytes <{179}> ={282}= ={383}= ={568}= ={767}= [rendered] split chunk (cache group: defaultVendors)
> ./c ./index.js 3:0-47
./node_modules/z.js 20 bytes [built] [code generated]
chunk (runtime: a) default/a.js (a) 245 bytes (javascript) 6.64 KiB (runtime) >{137}< >{568}< [entry] [rendered]
chunk (runtime: a) default/a.js (a) 245 bytes (javascript) 6.65 KiB (runtime) >{137}< >{568}< [entry] [rendered]
> ./a a
runtime modules 6.64 KiB 9 modules
runtime modules 6.65 KiB 9 modules
dependent modules 60 bytes [dependent] 3 modules
./a.js + 1 modules 185 bytes [built] [code generated]
chunk (runtime: main) default/async-a.js (async-a) 185 bytes <{179}> ={282}= ={767}= ={954}= >{137}< >{568}< [rendered]
Expand Down