Skip to content

Commit

Permalink
chore(projects): add vscode configuration & add vite preload
Browse files Browse the repository at this point in the history
  • Loading branch information
mufeng889 committed Aug 24, 2024
1 parent 2445424 commit 48cd07e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"source.organizeImports": "never"
},
"eslint.useFlatConfig": true,
"editor.guides.bracketPairs": "active",
"editor.formatOnSave": false,
"eslint.validate": ["html", "css", "scss", "json", "jsonc"],
"i18n-ally.displayLanguage": "zh-cn",
Expand Down
6 changes: 6 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import process from 'node:process';
import { defineConfig, loadEnv } from 'vite';
import { setupVitePlugins } from './build/plugins/index';
import { createViteProxy, getBuildTime } from './build/config';
import { include } from './build/optimize';

// https://vitejs.dev/config/
export default defineConfig(configEnv => {
const viteEnv = loadEnv(configEnv.mode, process.cwd()) as unknown as Env.ImportMeta;
Expand All @@ -15,6 +17,7 @@ export default defineConfig(configEnv => {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
optimizeDeps: { include },
css: {
preprocessorOptions: {
scss: {
Expand All @@ -30,6 +33,9 @@ export default defineConfig(configEnv => {
host: '0.0.0.0',
port: 9527,
open: true,
warmup: {
clientFiles: ['./index.html', './src/{pages,components}/*']
},
proxy: createViteProxy(viteEnv, configEnv.command === 'serve'),
fs: {
cachedChecks: false
Expand Down

0 comments on commit 48cd07e

Please sign in to comment.