mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-15 20:01:28 +00:00
fix: add rsbuild watchFiles config for bruno-app src/providers/* path and forceRefreshWatcher option for collection reopening (#4766)
* add rsbuild watchFiles config for src/providers and forceRefreshWatcher option for collection reopening * updated paths
This commit is contained in:
@@ -18,6 +18,21 @@ export default defineConfig({
|
||||
}
|
||||
})
|
||||
],
|
||||
dev: {
|
||||
watchFiles: {
|
||||
paths: [
|
||||
'src/providers/**',
|
||||
'src/utils/**',
|
||||
'src/hooks/**',
|
||||
'src/themes/**',
|
||||
'src/selectors/**'
|
||||
],
|
||||
options: {
|
||||
usePolling: false,
|
||||
interval: 1000,
|
||||
},
|
||||
},
|
||||
},
|
||||
source: {
|
||||
tsconfigPath: './jsconfig.json', // Specifies the path to the JavaScript/TypeScript configuration file,
|
||||
exclude: [
|
||||
|
||||
@@ -56,7 +56,12 @@ const openCollectionDialog = async (win, watcher) => {
|
||||
};
|
||||
|
||||
const openCollection = async (win, watcher, collectionPath, options = {}) => {
|
||||
if (!watcher.hasWatcher(collectionPath)) {
|
||||
if (!watcher.hasWatcher(collectionPath) || options.forceRefreshWatcher) {
|
||||
if (options.forceRefreshWatcher) {
|
||||
// the watcher is being refreshed, so we remove the existing watcher
|
||||
// when the collection is opened again in the gui, a new watcher will be created via the `renderer:mount-collection` handler
|
||||
watcher.removeWatcher(collectionPath);
|
||||
}
|
||||
try {
|
||||
let brunoConfig = await getCollectionConfigFile(collectionPath);
|
||||
const uid = generateUidBasedOnHash(collectionPath);
|
||||
|
||||
@@ -28,7 +28,8 @@ const registerPreferencesIpc = (mainWindow, watcher, lastOpenedCollections) => {
|
||||
for (let collectionPath of lastOpened) {
|
||||
if (isDirectory(collectionPath)) {
|
||||
await openCollection(mainWindow, watcher, collectionPath, {
|
||||
dontSendDisplayErrors: true
|
||||
dontSendDisplayErrors: true,
|
||||
forceRefreshWatcher: true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user