Comments (6)
I'm trying to use Remix on Hono's Vite dev-server. In that app, it can support "css side-effects imports" which is a matter of this issue:
So, we may make it by referring to Remix.
from honox.
Hi @ryuapp !
Thanks for the suggestion. I've implemented the feature of the Script
component to support it: #93. How about this?
from honox.
Hi @ryuapp
Can you share the example using Tailwind CSS with this PR? I want to know the setting. Using PostCSS?
from honox.
@ryuapp consider importing css this way
import styles from "../style.css?url"
export default jsxRenderer(async ({ title, children }) => {
return (
<html lang="en">
<head>
...
<link href={styles} rel="stylesheet" />
...
</head>
...
</html>
)
})
and updating your vite.config.ts
export default defineConfig(({ mode }) => {
if (mode === "client") {
return {
plugins: [client()],
}
}
return {
plugins: [honox(), pages()],
build: {
assetsDir: "static",
ssrEmitAssets: true,
},
}
})
from honox.
Thank you, @yusukebe!
Allow me to comment on just two points.
-
FOUC(flash of unstyled content)
I save files or reload a screen every time, a flicker occurs on dev mode.
Without this, the PR is a good DX. -
Only Global Style?
I don't have a problem as long as I can easily import tailwindcss, but there may be times when we want to load a css file only on a specific page. Therefore, I think it's best to be able to import it within files ofroutes
directory.
Even with the current PR, that meets my demands!
from honox.
@emmanuelchucks
I prefer it to the current config.
I currently use that config, but in the future I would like to configure it only with the import syntax.
Thank you!
from honox.
Related Issues (20)
- Ignore files having `$` as a prefix for routes
- Idea: Route-based API ? HOT 1
- Does it support wasm? HOT 6
- Add documentation on how to use HonoX outside of Cloudflare HOT 2
- Internal server error: Can't find variable: require HOT 2
- honox + auth.js HOT 2
- `onClick` doesn't "work"
- Better `EventAttributes` types HOT 1
- Issue with Vite and @azure/storage-blob Package HOT 6
- Cloudflare dependencies is included when is not used HOT 1
- valtio not working HOT 2
- development server take too long time
- Unable to use cookies through `hono/cookie` HOT 3
- Can't merge type of props for React renderer
- Support CDN baseUrl in `<Script>`
- Documentation - Starter Template - No x-basic option in hono-create command HOT 2
- HMR support for react renderer
- Vite plugin for sitemap.xml generation in SSR mode for HonoX
- Where should static assets be stored?
- HTMX Compatibility HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from honox.