-
Notifications
You must be signed in to change notification settings - Fork 3.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
file_packager: Add suport for glob or loading file list from file #18366
Comments
Both those features sound reasonable to me. |
If i understand correctly as per this issue we want to be able to do something like |
Another question I had at emscripten/tools/file_packager.py Line 431 in 03c61d5
we are setting source and destination path from the arg but when we use globs what should be the dest and source path? like in case of asset_dir/**/*.png should asset_dir maybe be the dest path? @sbc100
|
I think if we you want a different source and dest path then you use @ symbol in the argument so I agree we would have to come up with a mapping from source the dest that might be a little more complex. Its not clear how it would work, but I think the @ sign should continue to be the signal that you want a different source and dest. |
Yeah, there's no issue when the @ character is there then no issue its when we don't have it, any ideas or inspirations you can think of in this case? I have no experience here so asking 😅 |
When the @ char is not there, the user is saying that source and dest pathnames are the same. So shouldn't we just map every file in the glob that create corresponding file with the same name in the dest root. |
Ahh I think then if src is glob like we can recursively find all the files and append them as |
How else would the glob work, if not by recursively finding all the file? You can use python |
yes yes was a little confused at first 😅😅, will attempt this |
I think E. g. If user needs more precise control over this mapping, he would specify multiple glob patterns. |
Preload or embed necessary files inside a directory can reduce the size of WASM module substantially if there are multiple unnecessary files inside the same directory. In my case, I can reduce from size 62M to 23M. I think I can help to solve this issue. May I be the assignee? |
By all means, feel free to submit PR for this. |
Having said that, cant these use cases also be solves using a 2-phase deployment setup:
|
Seems workable! However, I think providing a general mapping option might easier for user (at least for me). |
I guess it depends on how much complexity this would add to file packager, vs how it is for users to do this copying/preparation step. In the world of open source software its very common to have a |
Agree. How about mention 2-stages deployment to the document and close this issue? Otherwise, I think this issue will keep opening. |
Sometimes you might not want to pack all files from a specific folder, but only some. In this case glob pattern (there is a function in the Python standard library for doing this) would be useful like
assets/**/*.png
, but it is not supported byfile_packager
. There is a workaround - you can specify all files explicitly by hand or generate a command line using another script. But in this case you may hit command line length limit on Windows if you have too many files. In such case it would be useful to be able to read file list from text file (e.g. compilers allow you to pass options using text files). But such feature is also missing fromfile_packager
.The text was updated successfully, but these errors were encountered: