
Security News
Knip Hits 500 Releases with v5.62.0, Improving TypeScript Config Detection and Plugin Integrations
Knip hits 500 releases with v5.62.0, refining TypeScript config detection and updating plugins as monthly npm downloads approach 12M.
@eckidevs/bun-plugin-vue
Advanced tools
A simple Vue plugin for [Bun](https://bun.sh) build, dev server etc. Made to be able to load SFC's into bun's bundler.
A simple Vue plugin for Bun build, dev server etc. Made to be able to load SFC's into bun's bundler.
[!IMPORTANT] This module is only compatible with the Bun Runtime.
bun add -D @eckidevs/bun-plugin-vue
If you want to have Vue's types, add a vue-shim.d.ts
file to the root of your project:
// vue-shim.d.ts
declare module '*.vue' {
import Vue from 'vue';
export default Vue;
}
The following is a quickstart, but see the examples
directory for full examples.
import vuePlugin from '@eckidevs/bun-plugin-vue'
Bun.build({
// index.html Imports main.ts where App.vue is setup
entrypoints: ['./index.html'],
outdir: './dist',
plugins: [vuePlugin()],
})
First create the local plugin file:
// vue-plugin.ts
import vuePlugin from '@eckidevs/bun-plugin-vue'
export default vuePlugin()
Then update bunfig.toml
[serve.static]
plugins = ["./vue-plugin.ts"]
The plugin has optional settings that you can pass:
interface VuePluginOptions {
prodDevTools?: boolean; // Default = false
optionsApi?: boolean; // Default = false
prodHydrationMismatchDetails?: boolean; // Default = false
}
prodDevTools
: If set to true
, it will enable Vue DevTools in production mode. This is useful for debugging but may expose sensitive information, so use with caution.optionsApi
: If set to true
, it will enable the Options API in Vue. This is useful if you want to use the Options API instead of the Composition API.prodHydrationMismatchDetails
: If set to true
, it will provide detailed error messages for hydration mismatches in production mode. This is useful for debugging hydration issues but may expose sensitive information, so use with caution.Because bun implements hot reloading in the Full-Stack Dev Server to eliminate HMR error logs, add the following to the main.ts where your vue app is created:
import { createApp } from 'vue';
import App from './App.vue';
const app = createApp(App);
// The important part for HMR
if (import.meta.hot) {
import.meta.hot.on('bun:invalidate', () => {
app.unmount();
})
import.meta.hot.accept()
}
app.mount('#app');
This HMR code will be dead-code eliminated during production.
FAQs
A simple Vue plugin for [Bun](https://bun.sh) build, dev server etc. Made to be able to load SFC's into bun's bundler.
We found that @eckidevs/bun-plugin-vue demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Knip hits 500 releases with v5.62.0, refining TypeScript config detection and updating plugins as monthly npm downloads approach 12M.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.