mirror of
https://github.com/planetrenox/inzerosight.git
synced 2026-03-17 03:01:02 +00:00
Refactor: support web target without extension plugin
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import webExtension from 'vite-plugin-web-extension';
|
||||
|
||||
const target = process.env.TARGET || 'firefox';
|
||||
|
||||
export default defineConfig({
|
||||
build: {
|
||||
outDir: `dist/${target}`,
|
||||
emptyOutDir: true,
|
||||
},
|
||||
plugins:[
|
||||
export default defineConfig(async () => {
|
||||
const plugins = [];
|
||||
|
||||
if (target !== 'web') {
|
||||
const { default: webExtension } = await import('vite-plugin-web-extension');
|
||||
plugins.push(
|
||||
webExtension({
|
||||
manifest: () => {
|
||||
const base = {
|
||||
@@ -49,6 +48,15 @@ export default defineConfig({
|
||||
},
|
||||
};
|
||||
},
|
||||
}),
|
||||
],
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
return {
|
||||
build: {
|
||||
outDir: `dist/${target}`,
|
||||
emptyOutDir: true,
|
||||
},
|
||||
plugins,
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user