GithubHelp home page GithubHelp logo

zerva-vite's Introduction

๐ŸŒฑ Zerva & Vite

This is a side project of Zerva

Integrate Vite development server including HMR etc.

Basically it is using the approach described here.

Use it like this in your project:

useVite({
  root: "..",
  www: "./www",
})

Where root is the path to the Vite project that should be served.

www would be the path where the Vite build should go to, to be served by Zerva. These are usually the generated files that land in dist but you can change the destination in the vite.config.tsvia build.outDir.

Usage

Usually you will use the zerva tool and everything is set up for you then. If you are not using a compile step, you'll need to activate the vite devoloper mode by setting then environment variable ZERVA_VITE=1 instead.

Directory structure

You should try to have 2 separate projects, one for your Vite code and one for your Zerva code. The reason is, you will very likely have different dependencies to 3rd party modules in both projects. You also do not want to blow up the server side code too much with Vite build tools etc.

You have these choices:

  1. Put both in the same directory and share the dependencies (not recommended).
  2. Have Zerva project in a subdirectory.
  3. Have Vite project in a subdirectory.
  4. Have subdirectories for both, side by side.

Usually option 2 works quite well. See demo code.

zerva-vite's People

Contributors

holtwick avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.