Archived
1
0

Feature/relative url (#307)

* resrouce relative url

* add url pathname for require.toUrl (fix webview url)

* rest resrouce relative url

* fix resource url

* ignore .vscode
This commit is contained in:
majik
2019-04-11 09:07:53 +08:00
committed by Asher
parent 3fae68bbab
commit 4b217fba00
4 changed files with 14 additions and 8 deletions

View File

@ -21,7 +21,7 @@ module.exports = (options = {}) => ({
// they are parsed as URIs and will throw errors if not fully formed.
// The !! prefix causes it to ignore other loaders (doesn't work).
search: "require\\.toUrl\\(",
replace: "location.protocol + '//' + location.host + '/' + require('!!file-loader?name=[path][name].[ext]!' + ",
replace: "location.protocol + '//' + location.host + location.pathname.replace(/\\/$/,'') + '/' + require('!!file-loader?name=[path][name].[ext]!' + ",
flags: "g",
}, {
search: "require\\.__\\$__nodeRequire",