Skip to content

stagas/vite-open

Repository files navigation

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.
  • Open files in VSCode by clicking links directly in Chrome DevTools using the open-in-editor Chrome extension (installed separately).
  • QR code display with the external address for easy access by phone.

API

# Options src/index.ts#L27
# VirtualModules src/.fastpm/-/vite-plugin-virtual@0.1.1/dist/index.d.ts#L4
# ViteServer src/server.ts#L10
# 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

Contributing

Fork or edit and submit a PR.

All contributions are welcome!

License

MIT © 2022 stagas