Skip to content

Commit c73afa4

Browse files
fix: improve auto publicPath detection
2 parents 1a6ac87 + 856c8d2 commit c73afa4

3 files changed

Lines changed: 238 additions & 238 deletions

File tree

lib/runtime/AutoPublicPathRuntimeModule.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class AutoPublicPathRuntimeModule extends RuntimeModule {
5656
"if(scripts.length) {",
5757
Template.indent([
5858
"var i = scripts.length - 1;",
59-
"while (i > -1 && !scriptUrl) scriptUrl = scripts[i--].src;"
59+
"while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;"
6060
]),
6161
"}"
6262
]),

test/Stats.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,10 @@ describe("Stats", () => {
175175
"assets": Array [
176176
Object {
177177
"name": "entryB.js",
178-
"size": 2985,
178+
"size": 3010,
179179
},
180180
],
181-
"assetsSize": 2985,
181+
"assetsSize": 3010,
182182
"auxiliaryAssets": undefined,
183183
"auxiliaryAssetsSize": 0,
184184
"childAssets": undefined,
@@ -223,10 +223,10 @@ describe("Stats", () => {
223223
"info": Object {
224224
"javascriptModule": false,
225225
"minimized": true,
226-
"size": 2985,
226+
"size": 3010,
227227
},
228228
"name": "entryB.js",
229-
"size": 2985,
229+
"size": 3010,
230230
"type": "asset",
231231
},
232232
Object {

0 commit comments

Comments
 (0)