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

Commit

Permalink
feat: added option "prefixPublicPathWithWebpackPublicPath"
Browse files Browse the repository at this point in the history
when the option is active, and a publicPath is set, it will prefix the provided publicPath with the dynamic __webpack_public_path__
  • Loading branch information
fabb committed Jun 12, 2019
1 parent 011cc38 commit c6a68c7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ export default function loader(content) {
}

publicPath = JSON.stringify(publicPath);

if (options.prefixPublicPathWithWebpackPublicPath) {
publicPath = `__webpack_public_path__ + ${publicPath}`;
}
}

if (typeof options.emitFile === 'undefined' || options.emitFile) {
Expand Down
3 changes: 3 additions & 0 deletions src/options.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
}
]
},
"prefixPublicPathWithWebpackPublicPath": {
"type": "boolean"
},
"context": {
"type": "string"
},
Expand Down

0 comments on commit c6a68c7

Please sign in to comment.