-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Parcel --public-url ./ doesn't support scripts and links in subfolders #2449
Comments
Is it a bug or a feature? Parcel bundles all your Javascript and CSS into separate files and places them near the processed HTML file. It replaces all the references in your script and link tags so that they point to the correct files. So what's the original problem you're trying to solve? All you Javascript and CSS should be working just fine. On a separate note, it's important to understand that the output bundles (e.g. You could have ten different |
If you require the same asset from 2 different places, parcel creates a shared bundle for both these files. Not sure why you wouldnβt want this though as it would save you or your company a bit of money and your users loading time. As there is only one bundle that needs to get cached at the cdn and user. In Parcel 2 weβve taken this a big step further with extracting shared assets into shared bundles. (As most applications share a couple libraries across various entrypoints) Sent with GitHawk |
It's not about feature or "best practice" in this case. |
@advename ow alright, will flag it as a bug again. |
|
Would someone like to tell us about the progress? |
I have the same problem. What can I do now? |
This bloody bug still exists. |
Is there a way to work around this? |
Any updates on this? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. |
π bug report
I have following file tree:
The step-1.html and step-2.html are both linking to the main.js and main.css. In order to get to that path I have to use
../scripts/main.js
and../styles/main.css
to access them. But when bundling them with parcel using following commandparcel build index.html --public-url ./
, parcel bundles the output as if they are in the same folder. Anchor tags, however, are working fine.π Configuration (.babelrc, package.json, cli command)
Zero config
π€ Expected Behavior
Parcel should bundle to the correct paths
π― Current Behavior
Parcel bundles to the root path for scripts and links
π» Code Sample
A full working example can be seen here:
https://github.com/advename/Parcel-error-example/tree/master
π Your Environment
The text was updated successfully, but these errors were encountered: