Vue Static SFC Plugin for Vite
Serve ".vue" files as static assets
About
Sourced from arikw/vite-plugin-vue-static-sfc README
Serve .vue files as static assets
Installation
npm install vite-plugin-vue-static-sfc
Usage
// vite.config.js
import staticVuePlugin from 'vite-plugin-vue-static-sfc';
// require('vite-plugin-vue-static-sfc') is also supported
export default {
plugins: [
staticVuePlugin()
]
};
Why
I've created a static website (a typing game for kids) that avoids build tools and uses vue3-sfc-loader to process .vue files dynamically at runtime.
While developing, I wanted to use Vite as an http server to serve the website and leverage its hot reloading, but it tried to process .vue files and requested to install a dedicated plugin to do so.
I just wanted Vite to serve the .vue files as if they were simple text files.
With this plugin, Vite will do that.
Notice
- The HMR will reload the entire webpage if a change in a
.vuefile is detected
More projects
See all →2024
vue-local-storage-reactivity
A Vue library that makes localStorage reactive
1 694 23/mo
2020
Sharing Components Between Nuxt 2.x And Vue CLI
A proof-of-concept project that demonstrates how components can be developed with a `Vue CLI` project and how to make them available to the `Nuxt` project
2020
Extension Page Context Runner
Run functions in page context directly from a browser extension content script
27
2020
Outlook Duplicated Items Remover
A VBA script that finds and moves duplicated items in selected outlook folders
21
2023
RX Input Layout Switcher
Alt+Shift keyboard layout switcher GNOME Shell Extension
16 9.6K
2025
Podman OpenRC Restart Policy Manager
This OpenRC init script manages the automatic startup and shutdown of Podman containers with the `restart-policy=always` on system boot or shutdown
5