Skip to content

mesopelagique/example-4d-vite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Using Vite to build web app

language language-top code-size

Example of database to create Vite(quickly) web app using popular js modules and framewords such as react, vuejs, svelte, ...

How to

Create a web app with vite

Go to your database root folder and type

 npm init vite your-app-name

Then select your preferred web framework (and then javascript or typescript):

Select a framework: › - Use arrow-keys. Return to submit.
❯  vanilla
   vue
   react
   preact
   lit
   svelte

It will create a folder with your app name (ie. your-app-name).

Go to this folder and install npm modules

cd your-app-name
npm install

Develop and test web app with node

You can type

npm run dev

A node http server will start at http://localhost:3000

You coud now develop your web app.

Deploy to 4D server

You must configure Vite to deploy on 4D WebFolder.

To do so edit vite.config.js and fill build.outDir with relative path.

export default defineConfig({
  ...,
  build: { outDir: "../WebFolder" }
})

Then type

npm run build

You could now open your browser and navigate to your 4D server url (for instance http://localhost)

More

Vite website

Vite in 100s

Youtube video

mesopelagique