Skip to content

Commit

Permalink
fix: improve auto publicPath detection
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Feb 15, 2024
2 parents 1a6ac87 + 856c8d2 commit c73afa4
Show file tree
Hide file tree
Showing 3 changed files with 238 additions and 238 deletions.
2 changes: 1 addition & 1 deletion lib/runtime/AutoPublicPathRuntimeModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class AutoPublicPathRuntimeModule extends RuntimeModule {
"if(scripts.length) {",
Template.indent([
"var i = scripts.length - 1;",
"while (i > -1 && !scriptUrl) scriptUrl = scripts[i--].src;"
"while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;"
]),
"}"
]),
Expand Down
8 changes: 4 additions & 4 deletions test/Stats.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,10 @@ describe("Stats", () => {
"assets": Array [
Object {
"name": "entryB.js",
"size": 2985,
"size": 3010,
},
],
"assetsSize": 2985,
"assetsSize": 3010,
"auxiliaryAssets": undefined,
"auxiliaryAssetsSize": 0,
"childAssets": undefined,
Expand Down Expand Up @@ -223,10 +223,10 @@ describe("Stats", () => {
"info": Object {
"javascriptModule": false,
"minimized": true,
"size": 2985,
"size": 3010,
},
"name": "entryB.js",
"size": 2985,
"size": 3010,
"type": "asset",
},
Object {
Expand Down

0 comments on commit c73afa4

Please sign in to comment.