-
-
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
Cannot serve static assets created via "parcel build src/index.html" #2624
Comments
Hello @mytee306, you can set the option
It would then serve the assets from Alternatively
Someone correct me if I'm wrong, but the reason it doesn't work is that by default parcel expects that the bundle is in the server's top-most / root directory. In github pages case, they are nested in |
@lustoykov Works like a charm, thank you so much! |
Shouldn't parcel change default then? Looks like a bug. |
@mihailik I was wondering the same, would be nice to hear the opinion of a contributor. As far as I can tell |
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. |
…and JavaScript assets issue: parcel-bundler/parcel#2624
Fixed a bug where the website was served without CSS and JavaScript assets Issue: parcel-bundler/parcel#2624
…and JavaScript assets issue: parcel-bundler/parcel#2624
Fixed a bug where the website was served without CSS and JavaScript assets Issue: parcel-bundler/parcel#2624
…and JavaScript assets issue: parcel-bundler/parcel#2624
…and JavaScript assets issue: parcel-bundler/parcel#2624
🐛 bug report
App works perfectly when running locally using
parcel src/index.html
, however after creating a production bundle by runningparcel build src/index.html
and attempting to serve the static assets using vscode live serve or serve the app is being served with missing CSS and JavaScript files. The same thing happens when the app is served via github pages. Interestingly enough, http-serve is able to serve the app in its entirety. The repository containing whole source code can be found here🎛 Configuration (.babelrc, package.json, cli command)
package.json
🤔 Expected Behavior
App is being served including CSS and JavaScript files.
😯 Current Behavior
App is served without CSS and JavaScript assets
Errors when accessing page served by github
💁 Possible Solution
Changing the mime types of CSS and JavaScript assets
💻 Code Sample
The repository containing whole source code can be found here
🌍 Your Environment
The text was updated successfully, but these errors were encountered: