Skip to content
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

Closed
jpeg729 opened this issue Mar 28, 2018 · 4 comments
Closed

Suggestion: myurl?static should tell parcel to copy the file as-is #1084

jpeg729 opened this issue Mar 28, 2018 · 4 comments
Labels
💬 RFC Request For Comments static

Comments

@jpeg729
Copy link

jpeg729 commented Mar 28, 2018

There are many situations where people want a way to use a file as-is without its contents being mangled by parceljs. For example...

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.

@DeMoorJasper
Copy link
Member

DeMoorJasper commented Mar 29, 2018

The manifest should work when using .webmanifest
Related to #1087

@DeMoorJasper DeMoorJasper added the 💬 RFC Request For Comments label Mar 29, 2018
@dandv
Copy link
Contributor

dandv commented Dec 21, 2018

Another use case: pro/paid libraries that detect when they have been tampered with. These might need to be served unmodified. CC @mkozhukh

@mischnic
Copy link
Member

Similar to #2306

@mischnic
Copy link
Member

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
Labels
💬 RFC Request For Comments static
Projects
None yet
Development

No branches or pull requests

4 participants