2022-10-07 17:07:59 +00:00
|
|
|
import { defineConfig } from 'vite'
|
|
|
|
import vue from '@vitejs/plugin-vue'
|
|
|
|
import { fileURLToPath, URL } from 'url'
|
|
|
|
import { crx } from '@crxjs/vite-plugin'
|
|
|
|
import manifest from './src/extension/manifest.json'
|
|
|
|
|
|
|
|
// https://vitejs.dev/config/
|
|
|
|
export default defineConfig({
|
|
|
|
publicDir: './public',
|
|
|
|
define: {
|
|
|
|
'process.env': {}
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
extensions: ['.ts', '.js', '.vue'],
|
|
|
|
alias: {
|
|
|
|
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
|
|
stream: 'stream-browserify',
|
|
|
|
http: 'http-browserify',
|
|
|
|
https: 'https-browserify',
|
|
|
|
util: 'util'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
build: {
|
|
|
|
rollupOptions: {
|
2024-05-03 09:53:24 +00:00
|
|
|
// plugins: [nodePolyfills()],
|
|
|
|
onwarn: (warning) => {
|
|
|
|
if (warning.message.includes('comment will be removed')) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
},
|
2024-01-24 00:41:31 +00:00
|
|
|
input: {
|
|
|
|
['eval-sandbox']: 'eval-sandbox.html',
|
|
|
|
},
|
2022-10-07 17:07:59 +00:00
|
|
|
},
|
2024-01-24 00:48:42 +00:00
|
|
|
sourcemap: false,
|
2022-10-07 17:07:59 +00:00
|
|
|
chunkSizeWarningLimit: 1000,
|
|
|
|
commonjsOptions: {
|
|
|
|
transformMixedEsModules: true
|
2022-10-30 23:34:21 +00:00
|
|
|
},
|
2022-10-07 17:07:59 +00:00
|
|
|
},
|
2024-05-03 09:53:24 +00:00
|
|
|
esbuild: {
|
|
|
|
legalComments: 'none',
|
|
|
|
},
|
2022-10-07 17:07:59 +00:00
|
|
|
plugins: [
|
2024-05-03 09:53:24 +00:00
|
|
|
crx({ manifest: manifest as any }),
|
2022-10-07 17:07:59 +00:00
|
|
|
vue()
|
|
|
|
],
|
|
|
|
server: {
|
|
|
|
port: 4766
|
|
|
|
}
|
|
|
|
})
|