Replies: 2 comments 1 reply
-
Hey! 👋 Thanks for this suggestion! 🙏 I think this would be a great candidate for a One of Marten's core principles is to remain frontend-agnostic, meaning it doesn't favor one specific frontend tool over another. I think it's essential to maintain this stance to keep Marten flexible and adaptable to various project needs. While adding built-in support for Vite might seem convenient, it could open the door to requests for support for other tools, potentially leading to complexity and confusion. As I mentioned previously, something like that would be a great idea for a |
Beta Was this translation helpful? Give feedback.
-
I agree with @ellmetha. Marten should be independent from any build systems. Otherwise it might be too high a hurdle for new developers, especially for the ones who don't have worked with nodejs. However, I could see this functionality being installed from the start with |
Beta Was this translation helpful? Give feedback.
-
Vite is useful for bundling frontend scripts, styles, resizing image assets, and preprocessing other assets.
Supporting Vite in Marten projects would be fairly easy, but would boost a lot in DX.
marten new
would generate configs automaticallytsconfig.json
- set the frontend directoryvite.config.ts
lib
directory from automatic watching as it wastes resourcesbiome.json
- configure asset directory path for the Biome linter/formatterassets
, because these need to be preprocessed, and the Vite build output should be served fromassets
. The Marten asset collector should not add sources to the served assets, only the build output. I recommend putting the sources intofrontend/
, maybesrc/frontend/
.vite
template tag, e.g.{% vite "frontend/app.ts" %}
(Vite docs for it)localhost:5173
).vite/manifest.json
)https://localhost:5173/@vite/client
inbase.html
for HMR and full page reloadBeta Was this translation helpful? Give feedback.
All reactions