Replies: 12 comments 14 replies
-
@mjackson @ryanflorence very important!! (sorry for the pings) |
Beta Was this translation helpful? Give feedback.
-
At the moment, I don't believe there are any plans to open the Remix compiler to customize the configuration. For now, you will need to use |
Beta Was this translation helpful? Give feedback.
-
As I said, the above works, but it could be a nice feature for remix. Esbuild has such a huge ecosystem of modifier plugins for how it builds, that it would open up a lot of easy & free features for remix. I looked at it a bit closer here and it appears they move the the esbuild dir, and overwrite how it works, which probably accounts for why it's so flakey. If there is interest in setting up some kind of override options in the builders I can work on a PR, it doesn't seem too terribly complicated. I'd rather not work on it though, if there is no hope of it being merged. Like it works ok for me, now. @kiliman are you a maintainer? Who makes these kinds of decisions for remix? |
Beta Was this translation helpful? Give feedback.
-
It's kinda important, especially for loading some CSS (specifically Stylus) files and other assets. It's not unleashing the power of Esbuild. |
Beta Was this translation helpful? Give feedback.
-
Hi, I am the owner of remix-esbuild-override. I happened to find this discussion. |
Beta Was this translation helpful? Give feedback.
-
I hope there is no offense taken. As I said, it got me running, so I appreciate it, but I agree it would be cool if there was a less-flakey way to do it. |
Beta Was this translation helpful? Give feedback.
-
I am currently working on some examples of solutions for libraries that don't work in cloudflare. I believe that instead of overriding esbuild, Remix should be supported to automatically polyfill Buffer when cloudflare is selected at runtime. |
Beta Was this translation helpful? Give feedback.
-
I would LOVE to see this as well. It would be awesome if Remix would expose an API similar to what is described here but mark it as |
Beta Was this translation helpful? Give feedback.
-
I made a new issue that tracks all this specific to the instructions for mantine, but generally I think |
Beta Was this translation helpful? Give feedback.
-
Hey folks, check my example to fix this issue https://gist.github.com/jdnichollsc/b73eca1f34bdd1e3a95283774fda2212 |
Beta Was this translation helpful? Give feedback.
-
We used @jdnichollsc's patch above and also the esbuild-override lib. Both fixed our issues with a missing process polyfill locally but when we tried to get our app deploying to vercel, we ran into all sorts of issues due to the way vercel handles Remix apps (they compile and deploy their own version of Remix that can't be patched): Given this we're faced with a trade-off matrix because of the lack of esbuild config built-into the app.
Unfortunately for us, to unblock our business and keep moving quickly, we're going to probably go with Option 3 of switching off of Remix. I'm writing this comment with the hope that someone from the Remix team sees it and considers reversing the decision to not allow esbuild configurability (or at least polyfill common libraries (buffer, processing, crypto, etc.)) out of the box as it is too limiting b/c of not being able to work with the rest of the JS ecosystem (& cloud providers like Vercel where we have other apps deployed) |
Beta Was this translation helpful? Give feedback.
-
As a newcomer to the ecosystem it does seem a little odd that there are multiple APIs exposed with the |
Beta Was this translation helpful? Give feedback.
-
It would be handy to have a built-in override for esbuild config, in remix.config.js. Currently I use remix-esbuild-override which messes with your esbuild config (as it's installed in node_modules.) It works ok, if you run it before every build, but it seems flakey & hacky, and it fails to work if I don't setup a
prebuild
script for it. It seems like it would work better to put it in remix, so we have a 1st-class way to override how esbuild works.Here is an example config, I am currently using, that injects my override to add
buffer
into global on cloudflare-workers (so mantine will work) and a couple other things.This sets up fake node ES6 stuff for the worker (so like
global
andBuffer
is defined) and lets me importgql
files (so I can keep my graphql queries in separate files.)Related: mantine/issues#1033
Beta Was this translation helpful? Give feedback.
All reactions