Parcel 2: Serving static data from the dev server
See original GitHub issue🙋 Feature request
Currently, there’s no way easy way to add additional data into the dist dir provided by serve. I’ve previously advocated for this use case (#2461), where I have large binary files like 3D data that I do not want to push through the build process. The intermediate workaround has been to place a folder symlink into the dist/ directory, which works OK – I can filter out text/html
responses on the client and pretend they are 404s.
Parcel 2 moves the dist dir into .parcel-cache, and seems to more aggressively wipe it. This means it’s very hard to get Parcel 2’s dev server to serve static data again. The code for serving static data is still there, however.
🤔 Expected Behavior
I would like a supported mechanism to serve static, unbuilt data from the Parcel dev server.
😯 Current Behavior
There is no way to serve static data, and the existing workarounds for Parcel 1 which were relied on by many is now effectively unusable.
💁 Possible Solution
Support extra configuration to the parcel dev server, either based on the code in #2461 or not.
🔦 Context
I believe I have provided a sufficient amount of context above.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:23
- Comments:18 (6 by maintainers)
Hello, So far I’ve been using parcel-plugin-static-files-copy to solve this, but ideally this should be built-in. Adding a +1 for this!
Hey, just also wanted to mention that these assets are:
So it definitely needs a directory that the app has access to when it’s running.