mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-05 19:24:39 +00:00
fix: builds failing in some cases + extension failing to load due to vite legacy api
This commit is contained in:
+17
-2
@@ -25,17 +25,32 @@ export function updateManifestPlugin(): PluginOption {
|
||||
console.log('** updated **');
|
||||
}
|
||||
|
||||
// Implement retry mechanism for file watching
|
||||
const watchWithRetry = () => {
|
||||
if (!fs.existsSync(manifestPath)) {
|
||||
console.log('Manifest not found, retrying in 1 second...');
|
||||
setTimeout(watchWithRetry, 1000);
|
||||
return;
|
||||
}
|
||||
|
||||
fs.watchFile(manifestPath, () => {
|
||||
console.log('** watchFile ** ');
|
||||
console.log('** watchFile **');
|
||||
try {
|
||||
const manifestContents = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
|
||||
if (manifestContents.web_accessible_resources.some((resource: any) => resource.use_dynamic_url)) {
|
||||
if (manifestContents.web_accessible_resources?.some((resource: any) => resource.use_dynamic_url)) {
|
||||
const updated = forceDisableUseDynamicUrl();
|
||||
if (updated) {
|
||||
server.ws.send({ type: 'full-reload' });
|
||||
console.log('** updated **');
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('Error reading manifest, will retry on next change:', error.message);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
watchWithRetry();
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
@@ -64,6 +64,9 @@ export default defineConfig({
|
||||
optimizeDeps: {
|
||||
include: ['@babel/runtime/helpers/extends', '@babel/runtime/helpers/interopRequireDefault'],
|
||||
},
|
||||
legacy: {
|
||||
skipWebSocketTokenCheck: true,
|
||||
},
|
||||
build: {
|
||||
outDir: resolve(__dirname, 'dist', mode),
|
||||
emptyOutDir: false,
|
||||
|
||||
Reference in New Issue
Block a user