Skip to content

Conversation

@arsnyder16
Copy link
Contributor

This enables a little more flexibility to what is and isn't excluded when packaging files.

In my scenario i have a semi large folder structure i would like to bundle but i need most files included but a few variant files i want to ignore so keep the .data file smaller.

only include png(s) that are specific to wasm

*.png
!*.wasm.png

@sbc100 sbc100 changed the title [file_packager] allow negative patterns in exclude argument [file_packager] Allow negative patterns in exclude argument Feb 12, 2026
Copy link
Collaborator

@sbc100 sbc100 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find the double negative here fairly hard to understand/explain.

Would it be maybe in these more complex cases to write a script to prepare you assets?

e.g.

$ ./prepare_assets.py assets/  files/
$ ./emcc --embed-files files

self.run_process([EMCC, 'main.c', '--embed-file', 'tst', '--exclude-file', '*.exe'])
self.assertEqual(self.run_js('a.out.js').strip(), '')

def test_exclude_file_negative(self):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you call these test_file_packager_exclude_file...?

@arsnyder16
Copy link
Contributor Author

Yes this what I do today but it just creates a duplicate which is not ideal

This follows the flow of say .gitignore, that was another thought I had was look for say .emscriptenignore

@sbc100
Copy link
Collaborator

sbc100 commented Feb 12, 2026

I think I'm a little wary of adding more complexity here. It seems like a fairly niche case that can be solved using an external script.

Is the local duplication of assets during a build a problem for you? Are these file huge? (Maybe you could use symlinks instead of copies, unless you on windows?)

@arsnyder16
Copy link
Contributor Author

Yea this didn't jar me as complex, especially since it's additive, but if it's too much we could close

@arsnyder16
Copy link
Contributor Author

This plays a little with #24802

Where I an trying to keep my artifact bundle size down for my automated tests

If there was a way to lazy load files through emrun it would solve all of this

@arsnyder16
Copy link
Contributor Author

Its not clear to me the status of WasmFS but there seemed to be some potential hope there where a server or local FS could work more like an NFS drive than needing to bundle and extract the whole FS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants