Add clear and explicit way to exclude files from bundle
I keep getting the need to exclude bundled files from time to time. In particular, I have a file with testing helpers that fails to compile because
convex-test uses crypto:I renamed the file
lib/test.nobundle.ts to work around it.While the heuristic of "exclude if multiple dots in path" accounts for a lot, it feels a little... flimsy? or something like that
For example, you might want a file that has multiple dots in the path to be included; I tried to name a file
something.node.ts as a companion to something.ts which includes the node actions, while the main file just has queries and mutations. I was confused for a hot minute why that wasn't included. I worked around it, but at the time, I didn't realize this rule was the cause.I would prefer one of these alternatives, in order of preference:
-
"exclude" or "ignore" config in convex.json- a filename convention, like I did here
-
"use nobundle" or "use exclude" or some other kind of file directiveSpecifically with the file config, it would have the default of excluding
.test. files or whatever else, and maybe you could add a special sigil for that, which I've seen in some config formats: