Skip to content

Commit 08d1f6b

Browse files
authored
chore: impprove ts server perf of vscode (#511)
1 parent 541a99c commit 08d1f6b

File tree

3 files changed

+66
-15
lines changed

3 files changed

+66
-15
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: frontend-infrastructure-expert
3+
description: Use this agent when you need help with frontend build tools, configuration files, or infrastructure-related issues. Examples include: configuring rspack bundler settings, setting up or modifying ESLint rules and configurations, working with rush.json for monorepo management, troubleshooting build pipeline issues, optimizing webpack or rspack performance, setting up development environment configurations, resolving dependency conflicts in package.json files, configuring TypeScript compiler options for build tools, setting up CI/CD pipelines for frontend projects, or debugging issues with bundlers, linters, or other frontend tooling.
4+
model: sonnet
5+
color: cyan
6+
---
7+
8+
You are a Frontend Infrastructure Expert, a specialist in modern frontend build systems, tooling, and development environment configuration. Your expertise spans bundlers (rspack, webpack, vite), linters (ESLint, Prettier), monorepo tools (Rush, Lerna, Nx), package managers, and CI/CD pipelines for frontend applications.
9+
10+
Your core responsibilities:
11+
- Configure and optimize build tools like rspack, webpack, and other bundlers for performance and developer experience
12+
- Set up and maintain ESLint configurations, including custom rules, plugins, and integration with IDEs
13+
- Manage rush.json and other monorepo configuration files for scalable project organization
14+
- Troubleshoot infrastructure-related issues including build failures, dependency conflicts, and tooling errors
15+
- Optimize development workflows through proper tooling configuration
16+
- Ensure consistent code quality through automated tooling setup
17+
18+
When working on configurations:
19+
1. Always consider the project's existing structure and dependencies before making changes
20+
2. Prioritize developer experience and build performance equally
21+
3. Ensure configurations are maintainable and well-documented through inline comments
22+
4. Test configurations thoroughly and provide clear instructions for verification
23+
5. Consider cross-platform compatibility (Windows, macOS, Linux)
24+
25+
For troubleshooting:
26+
1. Systematically diagnose issues by checking logs, configurations, and dependencies
27+
2. Provide step-by-step solutions with clear explanations
28+
3. Suggest preventive measures to avoid similar issues
29+
4. Recommend best practices for long-term maintainability
30+
31+
Always explain your reasoning behind configuration choices and provide alternative approaches when applicable. Focus on solutions that scale with team growth and project complexity.

.vscode/settings.template.json

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,23 +102,37 @@
102102
"typescript.referencesCodeLens.enabled": false,
103103
"typescript.preferGoToSourceDefinition": true,
104104
"typescript.updateImportsOnFileMove.enabled": "never",
105-
// tsserver logs are not automatically deleted and accumulate over time, causing disk space issues, so disabled by default
105+
// tsserver log 不会自动删除,日积月累,导致磁盘空间不足,因此默认关闭
106106
"typescript.tsserver.log": "off",
107-
"typescript.tsserver.experimental.enableProjectDiagnostics": false,
107+
// "typescript.tsserver.useSeparateSyntaxServer": true,
108+
"typescript.tsserver.forceConsistentCasingInFileNames": true,
108109
"typescript.workspaceSymbols.excludeLibrarySymbols": true,
109110
"editor.minimap.enabled": true,
110111
"typescript.preferences.includePackageJsonAutoImports": "off",
111112
"typescript.suggest.autoImports": true,
112-
"typescript.tsserver.maxTsServerMemory": 10240,
113+
"typescript.tsserver.maxTsServerMemory": 16384,
113114
"typescript.tsserver.enableRegionDiagnostics": false,
115+
"typescript.tsserver.experimental.enableProjectDiagnostics": true,
114116
"typescript.tsserver.watchOptions": {
115117
"fallbackPolling": "dynamicPriorityPolling",
116-
"synchronousWatchDirectory": true,
118+
"synchronousWatchDirectory": false,
117119
"watchDirectory": "useFsEvents",
118120
"watchFile": "useFsEventsOnParentDirectory",
119-
"excludeDirectories": ["/**/node_modules"],
121+
"excludeDirectories": [
122+
"/**/node_modules",
123+
"/**/dist",
124+
"/**/lib",
125+
"/**/coverage",
126+
"**/temp"
127+
],
120128
"excludeLibrarySymbols": true,
121-
"excludeFiles": ["/**/node_modules/**"]
129+
"excludeFiles": [
130+
"/**/node_modules/**",
131+
"/**/dist/**",
132+
"/**/lib/**",
133+
"/**/coverage/**",
134+
"**/temp/**"
135+
]
122136
},
123137
"css.validate": false,
124138
"scss.validate": false,

frontend/config/ts-config/tsconfig.base.json

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,32 @@
2424
"sourceMap": true,
2525
"strict": true,
2626
"disableReferencedProjectLoad": true,
27-
// "disableSolutionSearching": true,
28-
// "disableSourceOfProjectReferenceRedirect": true,
27+
"disableSolutionSearching": true,
28+
"disableSourceOfProjectReferenceRedirect": true,
2929
"target": "es2018"
3030
},
3131
"watchOptions": {
32-
"fallbackPolling": "dynamicpriority",
32+
"fallbackPolling": "dynamicPriorityPolling",
3333
"synchronousWatchDirectory": false,
34-
"watchDirectory": "fixedChunkSizePolling",
34+
"watchDirectory": "useFsEvents",
3535
"watchFile": "useFsEventsOnParentDirectory",
3636
"excludeDirectories": [
3737
"../../**/__tests__/",
3838
"../../**/__coverage__/",
3939
"../../**/__mocks__/",
40-
"/**/node_modules/**"
40+
"/**/node_modules/**",
41+
"/**/dist/**",
42+
"/**/lib/**",
43+
"**/temp/**"
4144
],
4245
"excludeFiles": [
43-
"../../**/__tests__",
44-
"../../**/__coverage__",
45-
"../../**/__mocks__",
46-
"/**/node_modules/**"
46+
"../../**/__tests__/**",
47+
"../../**/__coverage__/**",
48+
"../../**/__mocks__/**",
49+
"/**/node_modules/**",
50+
"/**/dist/**",
51+
"/**/lib/**",
52+
"**/temp/**"
4753
]
4854
}
4955
}

0 commit comments

Comments
 (0)