38 lines
798 B
TypeScript
38 lines
798 B
TypeScript
import { defineConfig } from 'vite';
|
|
import webExtension from 'vite-plugin-web-extension';
|
|
import path from 'path';
|
|
import { fileURLToPath } from 'url';
|
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
|
|
export default defineConfig({
|
|
root: 'src',
|
|
plugins: [
|
|
webExtension({
|
|
manifest: 'manifest.json',
|
|
watchFilePaths: ['**/*'],
|
|
browser: 'firefox',
|
|
}),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src'),
|
|
},
|
|
},
|
|
build: {
|
|
outDir: path.resolve(__dirname, 'dist'),
|
|
emptyOutDir: true,
|
|
rollupOptions: {
|
|
output: {
|
|
entryFileNames: '[name].js',
|
|
chunkFileNames: '[name].js',
|
|
assetFileNames: '[name].[ext]',
|
|
},
|
|
},
|
|
},
|
|
test: {
|
|
globals: true,
|
|
environment: 'jsdom',
|
|
},
|
|
});
|