ionic-cli icon indicating copy to clipboard operation
ionic-cli copied to clipboard

vite support

Open reslear opened this issue 3 years ago • 5 comments

add support vite builder with vue for live reloading, or how to use solution temporally ?

reslear avatar Nov 08 '21 19:11 reslear

Please, don’t do that

jcesarmobile avatar Nov 10 '21 09:11 jcesarmobile

any news?

reslear avatar Mar 15 '22 16:03 reslear

any news about support vite?

reslear avatar Apr 03 '22 11:04 reslear

We will update the issue when we have something. Please refrain from asking for updates.

mhartington avatar Apr 03 '22 23:04 mhartington

Please, let us at least know if support of Vite is being considered or not.

kuka-radovan avatar Apr 12 '22 14:04 kuka-radovan

Integration with Vite requires tweaks to config files:

capacitor.config.ts

const config: CapacitorConfig = {
  webDir: 'dist',
}

ionic.config.json

{
  "type": "custom"
}

package.json

{
  "scripts": {
    "ionic:serve": "vite",
    "ionic:build": "tsc && vite build"
  }
}

Now both ionic build and ionic serve commands work properly

References:

piotr-cz avatar Nov 03 '22 15:11 piotr-cz

@piotr-cz but without native-run :)

reslear avatar Nov 03 '22 17:11 reslear

@reslear I must say I haven't tried it yet.

You do you use it? The docs mention it only in context of ionic cordova run command.

piotr-cz avatar Nov 03 '22 18:11 piotr-cz

I used it, then I had to write my own sh script :) https://capacitorjs.com/docs/guides/live-reload#using-with-framework-clis

this is just for convenience, ideally it should be out of the box

reslear avatar Nov 03 '22 20:11 reslear

Locking this for now. This is planned for, and we have some branches which includes the work for it. But it will be part of a major version, since it does change how the CLI works internally.

mhartington avatar Nov 04 '22 13:11 mhartington

version 7.x of the CLI already supports vite for react and vue, and pretty sure angular also uses vite under the hood

jcesarmobile avatar Oct 12 '23 16:10 jcesarmobile