-
-
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
🐛 Can't serve static resources with no filename extension #1098
Comments
This is due to #974 as seen in the discussion there this is intended behaviour... |
Wait, why do you have files without an extension and how do they get to your dist folder? Parcel doesn’t generate files without extensions |
The use case is described in the "Context" section. I see that this behavior was introduced on purpose in #974, but the discussion there doesn't say why it should be considered desirable. What am I missing? Thanks! |
+1 - I don't think the bundler / http server should be making decisions about file extensions for the application for the author :) |
I do think that either |
I neither can't use my files without extensions, and I don't have the option to change their names. |
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. |
For those who might run into this in the future and want a simple solution that works relatively easily and as expected for Parcel 2 |
I need to verify my domain for Apple Pay, and this requires serving a static file without a file extension, so there is a use case for this. The parcel static files copy reporter, while helpful, doesn't actually solve the issue of parcel not serving files without a file extension. EDIT: never mind, just realised that files without extensions can be served when built on a server, which works well. It's just not available on locally served environment which is fine |
🐛 bug report
🎛 Configuration (.babelrc, package.json, cli command)
🤔 Expected Behavior
Static resources placed inside ./dist/ should be served regardless of filename extension.
In particular, files with no extension at all should be served with
content-type: application/octet-stream
.😯 Current Behavior
Files with no extension are specifically ignored and the main HTML bundle is sent instead. Adding any extension, even a meaningless one (e.g.
.foobar
) causes the file to serve properly.See also #974, #782, and (maybe peripherally related) #536 and #303.
💁 Possible Solution
Remove the "empty extension" test and let the file be served.
🔦 Context
After loading, my webapp fetches static resources that are just blobs with no filename extension. I want to use parcel serve during development, so I just put the static resources under ./dist/ in hopes of serving them. The resource format is not under my control so I can't just add a filename extension to those files.
For now my workaround is to serve just the resources using an http-server on a different port, but that's pretty unwieldy.
🌍 Your Environment
The text was updated successfully, but these errors were encountered: