Setup Multiple Pages with VITE

preview_player
Показать описание
This lesson quickly demonstrates how to add multiple pages to a #VITE application 🌹. This essentially means you get a multi page app without adding any specific routing library ❤️

#basarat

👇 ❤️ Subscribe for MOORE ❤️ 👇

**Feel Free To Read This Lot**

I'm Basarat, and I love helping developers. More about me:

Microsoft MVP for TypeScript
200K contributions on Stackoverflow. Top Contributor for TypeScript.
Book Author : Beginning NodeJS
Book Author : TypeScript Deep Dive
Creator of multiple hot ✨ed Github Open Source projects

Рекомендации по теме
Комментарии
Автор

Basarat you just extendend my lifespan.

In an internal project I will need to have 2 different React code bases, one using React vanilla Javascript, and another using TS. I was scratching my head about how to do such thing.

This approach may help me to achieve it, sparing me from days of stress.

ThiagoVieira
Автор

i was about to watch a ~2-3 hrs video of a project which includes multiple pages, but your just saved a ton of time❤

noproytsaad
Автор

You rock bro! I'm watching it from Brazil 🇧🇷

alberto
Автор

Thanks! Can we setup the routes so it works using /about, not /about/. Also, Let's say it's /src/pages/about, can we make it so localhost:3000/about goes to the about page, without specifying 'pages' in the URL, e.g. localhost:3000/about vs localhost:3000/pages/about.

muffinbubble
Автор

you have saved the day for me! . Thank you

tarunsukhu
Автор

is there is any shortcut to add whole folder to entry point ... i have lot of html files in diffrent folders

RutviK.
Автор

EDIT: also you have to move public into the src folder if you take this approach.
how is this different from something like react-router? is this similar but ssr routing?

seanpaulson
Автор

Why about/ not just "about" in url ?

tech-updates
Автор

Im getting problems using the dist folder in production, assets cant be reached by the subpages, any clues on how to solve this? or build an asset folder for each subpage?

DaMarin
Автор

Nice! Just what I was looking for! Always great content!!

davidtoska
Автор

Unforenately now with dev server it always servers the root index.html (localhost:3000/about wil still point to the root's index.html

rumenneshev
Автор

Thank you! I appreciate you for sharing your knowledge. It's not easy to explain things as well as you have. your rock!

srqsoccer
Автор

is it possible to use an index.php as a starting point instead of the default index.html???

DI_Dev
Автор

Interesting! I'd love to see how to do this without React or Typescript

sheriffderek
Автор

Great tutorial! Thanks for clear explanation and great video.

tannerbyers
Автор

i am working on hayride app so i want to create web & mobile multiple apps with same source and run & deploy Spartanly how can i do this with vite js

thank you

MrTarang
Автор

Impressive content, style, and cadence. I very much appreciate your effort! Keep up the great work, subbed.

traviswatson
Автор

Thanks. This really helped me resolving the paths.

michaelpumo
Автор

Using react-router-dom seems easier, am I wrong? What are the benefits of using this implementation instead of react-router-dom?

eulucaspedroabreu
Автор

This video may be a little bit outdated, but I've been trying to create a multi-page app with the React + TS template. And I am unable to do so. Anyone has an idea?

slowmowfit