An open API service indexing awesome lists of open source software.

https://github.com/stagas/vite-open

Open any file directly in a Vite dev server.
https://github.com/stagas/vite-open

dev-server file open vite

Last synced: 12 months ago
JSON representation

Open any file directly in a Vite dev server.

Awesome Lists containing this project

README

          


vite-open

Open any file directly in a Vite dev server.



npm i vite-open -g

pnpm add vite-open -g

yarn global add vite-open

## CLI




## Features

- **_Zero config, zero setup_**. Open `.js` `.jsx` `.ts` `.tsx` `.md` and `.html` files directly.
- **_Vite_** configured for development, **_all ESNext features_** and accurate sourcemaps.
- Strict CORS headers enabling **_all Web features_**.
- Compile time pattern-based **_debugging_** using [rollup-plugin-debug](https://github.com/stagas/rollup-plugin-debug).
- Open files in VSCode by **_clicking links directly_** in Chrome DevTools using the [open-in-editor](https://github.com/generalov/open-in-editor-extension) Chrome extension _(installed separately)_.
- **_QR code_** display with the external address for easy access by phone.

## API

# Options src/index.ts#L27

# noForce  =  false src/index.ts#L33

    boolean

# noOpen  =  false src/index.ts#L32

    boolean

# quiet  =  false src/index.ts#L36

    boolean

# responses  =  {} src/index.ts#L42

    Record<string, {


    # content src/index.ts#L44


      string

    # fn src/index.ts#L45

      # (server, req, res, next)

        # server


          ViteDevServer

        # req

          IncomingMessage

        # res

          ServerResponse

        # next

          NextFunction


        (server, req, res, next)  =>


          void

# type src/index.ts#L43

    string

}> # root  =  '.' src/index.ts#L29

    string

# virtual  =  {} src/index.ts#L40

    Record<string, any>

# viteOptions  =  {} src/index.ts#L53

    Partial<InlineConfig>

# VirtualModules src/.fastpm/-/vite-plugin-virtual@0.1.1/dist/index.d.ts#L4
# ViteServer src/server.ts#L10 # networkAddr src/server.ts#L14

    string

# vite src/server.ts#L16

    ViteDevServer

# VirtualModule src/.fastpm/-/vite-plugin-virtual@0.1.1/dist/index.d.ts#L3

    string | object

# virtualPlugin src/index.ts#L23

    any

# invalidateVirtualModule(server, id) src/.fastpm/-/vite-plugin-virtual@0.1.1/dist/index.d.ts#L7

    # server


      ViteDevServer

    # id

      string


    invalidateVirtualModule(server, id)  =>


      void
# open(options) src/index.ts#L114 # updateVirtualModule(plugin, id, value) src/.fastpm/-/vite-plugin-virtual@0.1.1/dist/index.d.ts#L8

    # plugin


      Plugin

    # id

      string

    # value


    updateVirtualModule(plugin, id, value)  =>


      void

## Credits

- [@babel/core](https://npmjs.org/package/@babel/core) by [The Babel Team](https://babel.dev/team) – Babel compiler core.
- [@babel/plugin-proposal-class-properties](https://npmjs.org/package/@babel/plugin-proposal-class-properties) by [The Babel Team](https://babel.dev/team) – This plugin transforms static class properties as well as properties declared with the property initializer syntax
- [@babel/plugin-proposal-decorators](https://npmjs.org/package/@babel/plugin-proposal-decorators) by [The Babel Team](https://babel.dev/team) – Compile class and object decorators to ES5
- [@babel/plugin-proposal-private-methods](https://npmjs.org/package/@babel/plugin-proposal-private-methods) by [The Babel Team](https://babel.dev/team) – This plugin transforms private class methods
- [@babel/plugin-transform-react-jsx](https://npmjs.org/package/@babel/plugin-transform-react-jsx) by [The Babel Team](https://babel.dev/team) – Turn JSX into React function calls
- [@babel/plugin-transform-typescript](https://npmjs.org/package/@babel/plugin-transform-typescript) by [The Babel Team](https://babel.dev/team) – Transform TypeScript into ES.next
- [@stagas/chalk](https://npmjs.org/package/@stagas/chalk) by [@stagas](@stagas/chalk) – Terminal string styling done right (+ CommonJS build)
- [@vitejs/plugin-basic-ssl](https://npmjs.org/package/@vitejs/plugin-basic-ssl) by [Evan You and Vite Contributors](https://github.com/vitejs)
- [decarg](https://npmjs.org/package/decarg) by [stagas](https://github.com/stagas) – decorator based cli arguments parser
- [everyday-node](https://npmjs.org/package/everyday-node) by [stagas](https://github.com/stagas) – Everyday node utilities.
- [everyday-utils](https://npmjs.org/package/everyday-utils) by [stagas](https://github.com/stagas) – Everyday utilities
- [github-markdown-css](https://npmjs.org/package/github-markdown-css) by [Sindre Sorhus](https://sindresorhus.com) – The minimal amount of CSS to replicate the GitHub Markdown style
- [open-in-editor-connect](https://npmjs.org/package/open-in-editor-connect) by [Evgeniy V. Generalov](https://github.com/generalov) – Open in editor middleware
- [qrcode-terminal](https://npmjs.org/package/qrcode-terminal) by [gtanner](https://github.com/gtanner) – QRCodes, in the terminal
- [rollup-plugin-debug](https://npmjs.org/package/rollup-plugin-debug) by [stagas](https://github.com/stagas) – Console debug statements that can be pattern toggled at compile time from comments in the code.
- [running-at](https://npmjs.org/package/running-at) by [Maximilian Schiller](https://github.com/BetaHuhn) – Get local and network ip address
- [vite](https://npmjs.org/package/vite) by [Evan You](https://github.com/vitejs) – Native-ESM powered web dev build tool
- [vite-plugin-babel](https://npmjs.org/package/vite-plugin-babel) by [Miłosz Mandowski](https://github.com/owlsdepartment) – Runs Babel in Vite during all commands
- [vite-plugin-markdown](https://npmjs.org/package/vite-plugin-markdown) by [Kengo Hamasaki](https://github.com/hmsk) – Import markdown files in vite
- [vite-plugin-virtual](https://npmjs.org/package/vite-plugin-virtual) by [patak-js](https://github.com/patak-js) – Virtual modules with HMR invalidation plugin for Vite

## Contributing

[Fork](https://github.com/stagas/vite-open/fork) or [edit](https://github.dev/stagas/vite-open) and submit a PR.

All contributions are welcome!

## License

MIT © 2022 [stagas](https://github.com/stagas)