create-chrome-ext
Version:
Scaffolding your chrome extension, multiple boilerplates supported!
40 lines (37 loc) • 857 B
text/typescript
import { defineConfig } from 'vite'
import { crx } from '@crxjs/vite-plugin'
import { svelte } from '@sveltejs/vite-plugin-svelte'
import path from 'path'
import sveltePreprocess from 'svelte-preprocess'
import manifest from './src/manifest'
export default defineConfig(({ mode }) => {
const production = mode === 'production'
return {
build: {
emptyOutDir: true,
outDir: 'build',
rollupOptions: {
output: {
chunkFileNames: 'assets/chunk-[hash].js',
},
},
},
plugins: [
crx({ manifest }),
svelte({
compilerOptions: {
dev: !production,
},
preprocess: sveltePreprocess(),
}),
],
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),
},
},
legacy: {
skipWebSocketTokenCheck: true,
},
}
})