-
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
Assets only imported in resource routes not included in build output #3414
Comments
I can reproduce this in my project. My current workaround is to put these images in |
Unfortunately, that approach doesn't benefit from fingerprinting (no hash for cache-busting), if I understand you correctly. My current workaround is to import them (again) in a UI route. 😕 |
🤖 Hello there, We just published version Thanks! |
Gave We can work around this by also importing the assets from within our client bundle. // entry.client.tsx
import { hydrate } from 'react-dom';
import { RemixBrowser } from 'remix';
/* requires are not tree shaken so the imports in that file are considered relevant for the frontend */
require('./routes/my-resouce-route[.]css');
hydrate(<RemixBrowser />, document); When you have server only code in the resource route you want to be more considerate than this, but you get the idea. |
yeah, the solution is that of #3841 |
Cool no prob! Thanks for working on this 👍 |
🤖 Hello there, We just published version Thanks! |
Worked like a charm, thank you so much ! |
Agreed, that seems to have done it. 👍 |
Fixed in 1.7.3 🎉 |
@pcattori, FYI this issue reoccurs when we use the unstable vite plugin :) I could reproduce it in one of the latest nightly releases. |
@manzano78 since this issue tracks the bug for the existing compiler, could you open up a separate issue (maybe linking to this one)? |
Sure! |
What version of Remix are you using?
1.5.1
Steps to Reproduce
Bonus steps:
Expected Behavior
I would expect an asset imported (only) in a resource route to be included in the build output.
Actual Behavior
The asset is not included in the build output unless it is also imported in a UI route.
The text was updated successfully, but these errors were encountered: