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

Can you support vite2 #139

Open
luocong2016 opened this issue Jul 1, 2021 · 1 comment
Open

Can you support vite2 #139

luocong2016 opened this issue Jul 1, 2021 · 1 comment

Comments

@luocong2016
Copy link

Can you support vite2.

@m0dch3n
Copy link
Owner

m0dch3n commented Aug 13, 2021

Hello @luocong2016 ,

I don't think, this can't easily be done.

This plugin is based on vue-cli, which uses webpack to build etc...

Vite replaces completely this process. So it would require some research on how to implement correctly...

Basically for dev build, it's spinning up a dev server with vue-cli and injecting in the webpack build process with

chainWebPack(platform)

the cordova.js file to load the cordova plugins from js side...

After the dev server is running, it is instructing cordova to not load the local files from cordova's www folder, but from the dev server...

process.env.CORDOVA_PREPARE_CONFIG = getCordovaPathConfig(platform)

For production build, I think it's easier to replace...

Instead of letting vue-cli build, then copying files to cordova's www folder, you just need to let vite build...

But I'm not sure, and haven't tried anything on this, as I do not have time for that... But feel free to further investigate and analyse the building possibilities with vite...

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

No branches or pull requests

2 participants