rescript-compiler
rescript-compiler copied to clipboard
If the filename is not a valid module name, allow multiple files with the same name
This is helpful for NextJS. We can now have the filename [slug].res
however that file can have multiple instances when using NextJS. Because the module is not accessible from the outside, it would be nice if the compiler allowed for multiple files with that name.
what's the current work around, create [slug].js
as a wrapper?
yes or change the attribute name like [blogSlug].res
Does the team have a rough estimate of when it would consider starting to work on this, if at all?
Proposed implementation, the module name can include a hash of the content (or based on another stable thing like the relative path of the file). When adding these characters to the filename the module is not accessible internally anyway.
My use cases is very similar to the original statement, but the typical example doesn't need to use [slug].res
. I encounter the same issue with: index.res
and subdir/index.res
.
I'm trying to use the optional catch all pattern, and I'm running into the following error:
bsb: [169/174] pages/[[...index]]-Ocamlorg.cmj
FAILED: pages/[[...index]]-Ocamlorg.cmj
We've found a bug for you!
/pages/[[...index]].res
Could not find the .cmi file for interface
/pages/[[...index]].mli.
Did I encounter some illegal character issue?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This would still be very helpful for NextJs app directory. Now that we have async
and directives, this task is the only thing that prevents a ReScript-only NextJs app directory project.