GithubHelp home page GithubHelp logo

vite-node's Introduction

vite-node

NPM version

Vite as Node runtime.

EXPERIMENTAL

Usage

npx vite-node index.ts

Options:

npx vite-node -h

Features

  • Out-of-box ESM & TypeScript support (possible for more with plugins)
  • Top-level await
  • Vite plugins, resolve, aliasing
  • Respect vite.config.ts
  • Shims for __dirname and __filename in ESM
  • Access to native node modules like fs, path, etc.
  • Watch mode (like nodemon)

When NOT to Use

  • Production, yet - in very early stage, check it later
  • Most of the time, when other tools can do that job
    • We need to start a Vite server upon each execution, which inevitably introduces some overhead. Only use it when you want the same behavior as Vite or the powerful plugins system (for example, testing components with a Vite-specific setup).

Why?

It runs Vite's id resolving, module transforming, and most importantly, the powerful plugins system!

How?

It fires up a Vite dev server, transforms the requests, and runs them in Node.

Credits

Based on @pi0's brilliant idea of having a Vite server as the on-demand transforming service for Nuxt's Vite SSR.

Thanks @brillout for kindly sharing this package name.

Sponsors

License

MIT License © 2021 Anthony Fu

vite-node's People

Contributors

antfu avatar yingpengsha 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.