Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vite support #46

Open
jiridenteo opened this issue Feb 3, 2023 · 4 comments
Open

Vite support #46

jiridenteo opened this issue Feb 3, 2023 · 4 comments
Labels
documentation Improvements or additions to documentation

Comments

@jiridenteo
Copy link

Hi,
how can I install this great package for Vite? Is it compatible? Thanks

@JuniorTour
Copy link
Owner

JuniorTour commented Feb 15, 2023

Yes, it works for vite!

1. With vitejs/vite-plugin-vue2 plugin (https://github.com/vitejs/vite-plugin-vue2)

Simply add options like below:

// vite.config.js
import { defineConfig } from "vite";
import { createVuePlugin } from "vite-plugin-vue2";

export default defineConfig({
  plugins: [
    createVuePlugin({
      jsx: true,
      vueTemplateOptions: {
        compiler: require('vue-template-babel-compiler'),
      },
    }),
  ],
}); 

2. underfin/vite-plugin-vue2 plugin (https://www.npmjs.com/package/vite-plugin-vue2)

This plugin contain [email protected] out of box: https://github.com/underfin/vite-plugin-vue2/blob/master/package.json#L71

Just add vite-plugin-vue2 plugin, new syntax like optional chaining will work.

@JuniorTour JuniorTour added the documentation Improvements or additions to documentation label Feb 23, 2023
@stephane303
Copy link

stephane303 commented Sep 15, 2023

Is it possible to use this with vite-plugin-vue2 ? https://github.com/vitejs/vite-plugin-vue2

@JuniorTour
Copy link
Owner

@stephane303 sure, see reply above you, it contains detail usage.

@stephane303
Copy link

Yes thanks, I got confused as yes it works with 2.7.14, but not (yet) with jest ... but I will get there ....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants