mirror of
https://github.com/stackblitz-labs/bolt.diy
synced 2025-06-26 18:26:38 +00:00
fix: optimize file watch paths for preview updates and fix npm crashes.
Update the file watch paths in the previews store to only include relevant file types (e.g., HTML, CSS, JS) and exclude unnecessary directories (e.g., node_modules, dist). This reduces unnecessary file system events and improves performance. Also, update the @webcontainer/api dependency to the latest internal version for enhanced functionality, node20 etc.
This commit is contained in:
parent
0202aefad9
commit
7615c956c2
@ -154,7 +154,11 @@ export class PreviewsStore {
|
||||
try {
|
||||
// Watch for file changes
|
||||
webcontainer.internal.watchPaths(
|
||||
{ include: ['**/*'], exclude: ['**/node_modules', '.git'], includeContent: true },
|
||||
{
|
||||
// Only watch specific file types that affect the preview
|
||||
include: ['**/*.html', '**/*.css', '**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx', '**/*.json'],
|
||||
exclude: ['**/node_modules/**', '**/.git/**', '**/dist/**', '**/build/**', '**/coverage/**'],
|
||||
},
|
||||
async (_events) => {
|
||||
const previews = this.previews.get();
|
||||
|
||||
|
@ -101,7 +101,7 @@
|
||||
"@types/react-beautiful-dnd": "^13.1.8",
|
||||
"@uiw/codemirror-theme-vscode": "^4.23.6",
|
||||
"@unocss/reset": "^0.61.9",
|
||||
"@webcontainer/api": "1.3.0-internal.10",
|
||||
"@webcontainer/api": "1.5.3-internal.2",
|
||||
"@xterm/addon-fit": "^0.10.0",
|
||||
"@xterm/addon-web-links": "^0.11.0",
|
||||
"@xterm/xterm": "^5.5.0",
|
||||
|
Loading…
Reference in New Issue
Block a user