Skip to content
This repository was archived by the owner on Mar 17, 2021. It is now read-only.

Commit c6a68c7

Browse files
committed
feat: added option "prefixPublicPathWithWebpackPublicPath"
when the option is active, and a publicPath is set, it will prefix the provided publicPath with the dynamic __webpack_public_path__
1 parent 011cc38 commit c6a68c7

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ export default function loader(content) {
4242
}
4343

4444
publicPath = JSON.stringify(publicPath);
45+
46+
if (options.prefixPublicPathWithWebpackPublicPath) {
47+
publicPath = `__webpack_public_path__ + ${publicPath}`;
48+
}
4549
}
4650

4751
if (typeof options.emitFile === 'undefined' || options.emitFile) {

src/options.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
}
3232
]
3333
},
34+
"prefixPublicPathWithWebpackPublicPath": {
35+
"type": "boolean"
36+
},
3437
"context": {
3538
"type": "string"
3639
},

0 commit comments

Comments
 (0)