-
-
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
Suggestion: myurl?static should tell parcel to copy the file as-is #1084
Comments
The manifest should work when using |
Another use case: pro/paid libraries that detect when they have been tampered with. These might need to be served unmodified. CC @mkozhukh |
Similar to #2306 |
With Parcel 2 alpha 3 and this parcelrc {
"extends": "@parcel/config-default",
"transforms": {
"url:*": ["@parcel/transformer-raw"]
}
} you can import files which will then be copied to the dist folder: import file from "url:./static.json"
fetch(file)... Regarding syntax discussion (protocol vs query) see here: #3477 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There are many situations where people want a way to use a file as-is without its contents being mangled by parceljs. For example...
<link rel="manifest" href="manifest.json">
transforms manifest.json into a .js filefunction MyComponent () { return <iframe src='./assets/index.html' /> }
needed the html file to be unadulterated.axios.get('data/data.json',).then((data) => console.log(data))
inlines the potentially huge data.json and the http request fails.What if we could add "?static" to those urls, and have parceljs simply copy the resulting file to
/dist
? Parcel should still mangle the filename for cache busting.Going a little further, "?static&no-mangle" could tell parcel to copy the file as-is without mangling the filename.
Granted there are workarounds for all of the problems listed above, but it would be nice to have a simple and generic way to sidestep the problem without searching for the specific answer.
The text was updated successfully, but these errors were encountered: