Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

defaultPublicPath argument to methodName function #112

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sachin-hg
Copy link

Sometimes it's required to modify the publicPath while taking the defaultPublicPath as a parameter

Usecase: Multiple webpack builds on same page: and defaultPublicPath for each is something like: //mydomain.com/static/<APP_NAME>/ now I need to change it to //myOtherDomain.com/static/<APP_NAME>/

therefore, if I use the plugin like so:

new WebpackRequireFrom({methodName: 'get_public_path'})

and have get_public_path defined like so:

window.get_public_path = defaultPublicPath => defaultPublicPath.replace('myDomain', 'myOtherDomain')

I would be able to achieve it for all apps

Sometimes it's required to modify the publicPath while taking the defaultPublicPath as a parameter

Usecase: Multiple webpack builds on same page: and defaultPublicPath for each is something like: //mydomain.com/static/<APP_NAME>/
now I need to change it to //myOtherDomain.com/static/<APP_NAME>/

therefore, if I use the plugin like so:

new WebpackRequireFrom({methodName: '__get_public_path__'})

and have __get_public_path__ defined like so:

window.__get_public_path__ = defaultPublicPath => defaultPublicPath.replace('myDomain', 'myOtherDomain')

I would be able to achieve it for all apps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant