README
vite-open
open a file in a vite dev server
🔧 Install · 🧩 Example · 📜 API docs · 🔥 Releases · 💪🏼 Contribute · 🖐️ Help
Install
npm i -g vite-open
Example
vite-open my-file.ts
Usage
Usage: vite-open [options] <file>
<file> File to open (can be a .js or .ts file)
--root=... Root directory to serve files from
--https Use https
--quiet Quiet output
API
Table of Contents
open
Open a file in Vite.
Parameters
options
Partial<Options> Open optionsoptions.log
Log functionoptions.file
File to open (can be a .js or .ts file)options.root
Root directory to serve files fromoptions.https
Use httpsoptions.quiet
Quiet output
Returns Promise<ViteServer> ViteDevServer
ViteServer
ViteServer return object.
localAddr
The local address
Type: string
networkAddr
The network address
Type: string
vite
The Vite dev server instance
Type: ViteDevServer
createViteServer
Creates a vite dev server instance.
Parameters
viteConfig
ViteConfig Vite configuration. (optional, default{}
)
Returns Promise<ViteServer> ViteServer
Contribute
All contributions are welcome!
License
MIT © 2022 stagas