ignore files in convex folder
Can I put file in the convex folder and make them ignored, so they dont get loaded ?
13 Replies
There is not besides that filenames with multiple dots are not included, like messages.test.ts and messages.js.anotherextension. https://github.com/get-convex/convex-js/blob/main/src/bundler/index.ts#L346-L347
Would appreciate hearing about your use case
I want to put some Rescript files inside Convex. And calling the generated js from queries.
they are .res files
I am getting this:
ā ¼ Preparing Convex functions...
ā [ERROR] No loader is configured for ".res" files: convex/test.res
I guess you might have to make a fork for now
If needed
so the answer is no ?
fork is OVERKILL. it's simpler to just do a prebuild step, that copies the files I WANT to the convex folder.
just waiting for the 'official confirmation' that it's not possible, and Thanks !!
As Tom wrote above, no, all files are processed (although I think this could be considered a bug and we should only process the extensions we know we can handle,
[tj]sx?
).
You could do foo.bla.res
and compile that to foo.js
.I was thinking that too
Or have configurable conditions
Not elegant ! do you agree ? it's like naming my files based on a limitation that might change in convex. ignoring files with 2 dots is not robust / nor definitive IMO.
this is discriminatory code š
hehe
for only supporting emacs nerds ! š
if i were in your position, i would put them in a separate folder outside of
convex/
, like /convex_rescript/test.res
and have the compilation move the .js
files into the convex/
directory.rescript has nice feature, the compiled js is in the same folder as the .res file.
when you delete .res is deletes the compiled .js automatically.
so to keep that workflow, it has to be a 'build step that copies the js file AFTER compilation'
but you know, this will comeup again IMO for you guys. Hardcoding all the cases is not fun to maintain for you guys. Already you are ignoring README.me, emacs, etc ...
Helpful to hear! We'll consider config for this kind of integration. One important customization we'll likely support here is esbuild plugins, or potentially full bundler customization were you give us an executable to call.
It looks like it's hard to customize the output directory for Rescript https://rescript-lang.org/docs/manual/latest/build-configuration#package-specs so I can see how this would be helpful.
ReScript Documentation
Build System Configuration | ReScript Language Manual
Details about the configuration of the ReScript build system (rescript.json)
I'd still go with Lee's suggestion for now, you just need your own script syncing into (a .gitignored?) portion of the convex directory.
I think the quickwin is to ignore my build logic and be neutral to my setup.
I will use only one of these 2 solutions:
- pull files: convex allows .convex_ignore in /convex, to that you pull what you want. by default you pull everything
- push files: I create a folder, I push to /convex what I want
I don't need nothing for the push pipeline, so I am doing that for now.
I'll do pull when and if you provide the setup.
I will not integrate my pipelines with convex, just to keep thinks orthogonal and independent.