forked from izu/student-web-if-development-kit
Fix RODA dashboard data fallback
This commit is contained in:
+15
-1
@@ -55,6 +55,20 @@ function copyStaticAssets() {
|
||||
};
|
||||
}
|
||||
|
||||
function copyRodaDashboardSnapshot() {
|
||||
return {
|
||||
name: 'copy-roda-dashboard-snapshot',
|
||||
closeBundle() {
|
||||
const source = path.join(root, 'groups', 'RODA', 'dashboard-snapshot.txt');
|
||||
const destination = path.join(root, 'dist', 'groups', 'RODA', 'dashboard-snapshot.txt');
|
||||
|
||||
if (existsSync(source)) {
|
||||
cpSync(source, destination);
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
async function requestRodaDashboardHtml() {
|
||||
const controller = new AbortController();
|
||||
const timeoutId = setTimeout(() => controller.abort(), 12000);
|
||||
@@ -178,7 +192,7 @@ function serveRodaDashboardApi() {
|
||||
}
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [serveRodaDashboardApi(), embedRodaDashboardData(), copyStaticAssets()],
|
||||
plugins: [serveRodaDashboardApi(), embedRodaDashboardData(), copyStaticAssets(), copyRodaDashboardSnapshot()],
|
||||
build: {
|
||||
rollupOptions: {
|
||||
input: collectHtmlInputs(root),
|
||||
|
||||
Reference in New Issue
Block a user