You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to revive #5121, and provide more context.
🙋 feature request
Make public url parameter available inside the app.
🤔 Expected Behavior
Expose the argument to parcel --public-url to the user code, such as via process.env.PUBLIC_URL.
😯 Current Behavior
There's apparently no way to retrieve the argument to parcel --public-url programmatically in the user code.
💁 Possible Solution
A workaround is to explicitly specify the public url PUBLIC_URL=<public url> parcel build --public-url <public url>.
🔦 Context
For example, when deploying single page apps built using React Router under a subfolder, it's cleaner to pass the base url to BrowserRouter programmatically. This is useful when, for example, deploying SPA using GitHub pages, when the site would be available under <username>.github.io/<repo name>
I'd like to revive #5121, and provide more context.
🙋 feature request
Make public url parameter available inside the app.
🤔 Expected Behavior
Expose the argument to
parcel --public-url
to the user code, such as viaprocess.env.PUBLIC_URL
.😯 Current Behavior
There's apparently no way to retrieve the argument to
parcel --public-url
programmatically in the user code.💁 Possible Solution
A workaround is to explicitly specify the public url
PUBLIC_URL=<public url> parcel build --public-url <public url>
.🔦 Context
For example, when deploying single page apps built using React Router under a subfolder, it's cleaner to pass the base url to
BrowserRouter
programmatically. This is useful when, for example, deploying SPA using GitHub pages, when the site would be available under<username>.github.io/<repo name>
💻 Examples
See the above context. webpack seems to have some support https://webpack.js.org/guides/public-path/
The text was updated successfully, but these errors were encountered: