-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(remix-dev/compiler): add CSS plugin to esbuild
#4130
Conversation
🦋 Changeset detectedLatest commit: f77eeca The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Hi @KingSora, Welcome, and thank you for contributing to Remix! Before we consider your pull request, we ask that you sign our Contributor License Agreement (CLA). We require this only once. You may review the CLA and sign it by adding your name to contributors.yml. Once the CLA is signed, the If you have already signed the CLA and received this response in error, or if you have any questions, please contact us at [email protected]. Thanks! - The Remix team |
Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳 |
esbuild
first off, thanks a ton for looking into this!
looks like data urls, regular urls and id "imports" work, but an absolute path doesn't as a result of using the "css loader" it appears |
@mcansh thanks for taking a look! :) I've pushed an update fixing the absolute path url stuff.. |
I've been thinking about this a bit, as far as making sure files from |
@mcansh I've now improved the code by removing all the Edit: Also added |
this is looking great @KingSora, one thing i noticed when playing around with it today is that in order to use a fontforge package with fonts and css, you need to explicitly add the basic change to use |
@mcansh thanks for the review! Are you sure this is due to this plugin? I thought in the On a side note, I could also add caching here, so that this process is even faster |
I think so? altering the filter to have everything go through it allows for edit: actually building is fine with the changed filter, but dev doesn't work with it.. |
@mcansh whats the error you get in dev mode if you change the filter regex and check the file extension inside the |
this happens when using either filter for
|
@mcansh would you say this functionality is crucial for this PR to be merged? If so, I can try to fix it in a "hacky" way. If not I would open a issue in the esbuild repo, and we could improve on that behavior in a follow up PR... what do you think? |
personally, I think it's fine as is if we add something about it to https://remix.run/pages/gotchas |
no "as" type casting, use invariant instead of enforcing a thing is defined Signed-off-by: Logan McAnsh <[email protected]>
Signed-off-by: Logan McAnsh <[email protected]>
🤖 Hello there, We just published version Thanks! |
@mcansh I've created an issue in the esbuild repo, and the answer is: evanw/esbuild#2616 So as stated in my answer here: #4130 (comment) I believe everything should be fine with this plugin, are you sure other plugins aren't changing the Also here a minimal example: https://stackblitz.com/edit/node-2fnbwh?file=index.mjs |
thanks for the exploration @KingSora, we're hesitant to bump esbuild currently as there's a few things in there we need to test out (native pnp support included), looking into it soon just cut an experimental release with esbuild 0.15.11 |
Just out of curiosity. Are the imported assets then hashed? Would asset preloads then be so simple if it were to be hashed? |
@KingSora hello. I updated the remix and ran into an error like never before.
Is there any way to solve this? |
The best course of action is to open a new discussion in order for your question tu be visible. A comment on a closed PR will likely be dismissed. |
I was able to disable |
@jdnichollsc @Kim-Chuljoong I've just ran into this problem today, have you found any other solution? |
I also faced the same issue (remix + Cloudflare pages setup) :: Building Remix app in production mode... ✘ [ERROR] [plugin css-file] Build failed with 2 errors:
Build failed with 1 error: Please do let us know if we have a fix for this? How can we temporarily disable cssFilePlugin in this case? Please do let us know in the discussion please. |
am also having this same issue
|
Closes: #1153
Testing Strategy:
I've tested it like:
_assets
folder (server and client)Note: I have only tested relative url imports (
background: url('./relative');
), the following are untested:background: url('/absolute');
background: url('data:image/gif;base64,...');
background: url('http://...');
background: url('#myid');