refactor
This commit is contained in:
@@ -1,10 +1,16 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import webExtension from 'vite-plugin-web-extension';
|
||||
import { SCRIPT_FILES } from './utils/constants.js';
|
||||
import { SCRIPT_FILES } from './src/utils/constants.js';
|
||||
import path from 'path';
|
||||
|
||||
const isDev = process.env.NODE_ENV === 'development';
|
||||
|
||||
export default defineConfig({
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, 'src'),
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
webExtension({
|
||||
// 这个项目中所有需要注入的脚本都需要在这里指定,因为它们不会自动被插件检测到
|
||||
@@ -22,9 +28,9 @@ export default defineConfig({
|
||||
rollupOptions: !isDev ? undefined : {
|
||||
output: {
|
||||
// 开发模式下不压缩文件名,便于调试
|
||||
chunkFileNames: '[name].js',
|
||||
entryFileNames: '[name].js',
|
||||
assetFileNames: '[name].[ext]',
|
||||
chunkFileNames: 'src/[name].js',
|
||||
entryFileNames: 'src/[name].js',
|
||||
assetFileNames: 'src/[name].[ext]',
|
||||
compact: false, // 禁用代码压缩
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user