0.4.0 • Published 1 year ago

vite-plugin-vue-to-native v0.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

A Vite plugin fixing HMR support for Vue components using vue-facing-decorator without using the recommended toNative method.

How to use it

// vite.config.js
import vueToNative from "vite-plugin-vue-to-native";

export default {
  plugins: [vueToNative()]
}

Some context :

The vue-facing-decorator library recommends to call this method on every Vue components :

@Component
export class MyComp extends Vue{}
export default toNative(MyComp)

Not doing that will break Vite HMR on every Vue components.

But, using toNative totally breaks some IDE (WebStorm : https://youtrack.jetbrains.com/issue/WEB-64939/Vue-3-vue-facing-decorator-toNative).

This plugin allows you to not declare toNative() in your Vue component to keep good IDE support but to still enjoy Vite HMR.

Under the hood, it's adding toNative() automatically during the Vite build process.

License

MIT License © 2024 Arakmar

0.4.0

1 year ago

0.3.0

1 year ago

0.2.0

1 year ago

0.1.0

1 year ago