I'm making an extension and using npm run build (with vue cli) to make my option page. I need to interact with chrome.local.storage. So for now every change I need to make a new build and then test it in the extension.
It would be nice to have some "live build folder"
I can use esbuild or esbuild-vue, but with Vuetify on my project I cant get it working
For now I'm using esbuild-vue:
const vuePlugin = require('esbuild-vue');
require('esbuild').build({
entryPoints: ['main.js'],
bundle: true,
outfile: 'out.js',
plugins: [vuePlugin()],
watch: {
onRebuild(error, result) {
if (error) console.error('watch build failed:', error)
else console.log('watch build succeeded:', result)
},
},
define: {
"process.env.NODE_ENV": JSON.stringify("development"),
},
});
Ok, Vuetify 3 (Alpha) + Vite is working for me.
Example
For an example project you can clone: https://github.com/zoutepopcorn/extension-live-build
Setup
First setup a new project
vue create my-appwith vuetifyvue add vuetifyThen choose:
Now edit the
vite.config.jsand add build and base:Now you have setup folders front-end and webextension like this:
Now you can have you're package.json like this: