Vite: Support for development builds

Created on 16 May 2020  路  4Comments  路  Source: vitejs/vite

Hello, I want to use vite to develop a chrome extension but didn't want to stop the server and do a prod build every time I do a change so I can test it in chrome.

Is there a way to do development builds?

I think in vue-cli we can do it like this npx vue-cli-service build --mode development.

I want to point my extension to the dist folder generated every time I hit save so I can just refresh the chrome extension.

Thanks!

enhancement

Most helpful comment

It kinda defeats the purpose to use Vite for developing Chrome extensions, since you are pretty much asking for a full bundling mode even during dev. That's the exact thing Vite is trying to avoid.

All 4 comments

It kinda defeats the purpose to use Vite for developing Chrome extensions, since you are pretty much asking for a full bundling mode even during dev. That's the exact thing Vite is trying to avoid.

Thanks. Makes sense.

Isn't there another solution to build extensions using Vite?

We don't need to do a full blown build on each change. I don't know much about how Vite works, but the dev server can probably do the trick. As rendering a popup in a chrome extension is done by specifying the path of an html page that's used. In that html page, you can specify the paths of your js files and all the rest as usual.

Here is an example rollup plugin for building chrome extensions.

Can you help us with this @yyx990803?
Thanks a lot.

@sorxrob can you repoen please? I think it's still a valid issue.

Was this page helpful?
0 / 5 - 0 ratings