chore: eslint 配置
This commit is contained in:
@ -7,29 +7,14 @@ import { defineConfig, loadEnv } from 'vite';
|
||||
import { cesiumBaseUrl, Plugins } from './vite.config.plugins';
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig(({ mode, command }) => {
|
||||
export default defineConfig(({ command, mode }) => {
|
||||
const isBuild = command === 'build';
|
||||
const env = loadEnv(mode, process.cwd());
|
||||
|
||||
return {
|
||||
base: env.VITE_BASE,
|
||||
plugins: Plugins(),
|
||||
define: {
|
||||
$__DEV__: JSON.stringify(!isBuild),
|
||||
CESIUM_BASE_URL: JSON.stringify(`/${cesiumBaseUrl}`),
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
||||
},
|
||||
},
|
||||
server: {
|
||||
proxy: createViteProxy(),
|
||||
allowedHosts: ['.nwct.dev'],
|
||||
},
|
||||
build: {
|
||||
minify: 'terser',
|
||||
sourcemap: mode !== 'production' || env.VITE_SOURCE_MAP === 'true',
|
||||
rollupOptions: {
|
||||
onwarn: (warning, warn) => {
|
||||
if (warning.code === 'EMPTY_BUNDLE') return;
|
||||
@ -54,6 +39,21 @@ export default defineConfig(({ mode, command }) => {
|
||||
// },
|
||||
},
|
||||
},
|
||||
sourcemap: mode !== 'production' || env.VITE_SOURCE_MAP === 'true',
|
||||
},
|
||||
define: {
|
||||
$__DEV__: JSON.stringify(!isBuild),
|
||||
CESIUM_BASE_URL: JSON.stringify(`/${cesiumBaseUrl}`),
|
||||
},
|
||||
plugins: Plugins(),
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
||||
},
|
||||
},
|
||||
server: {
|
||||
allowedHosts: ['.nwct.dev'],
|
||||
proxy: createViteProxy(),
|
||||
},
|
||||
};
|
||||
});
|
||||
|
Reference in New Issue
Block a user