add app_root to dashboard widget path, add buildtimestamp to external imports during rollup build

This commit is contained in:
Harald Bamberger
2025-10-28 17:01:05 +01:00
parent eafe5da311
commit a4d3015367
2 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -144,7 +144,7 @@ export default {
},
async created() {
this.widget = await CachedWidgetLoader.loadWidget(this.id);
let component = (await import("../" + this.widget.setup.file)).default;
let component = (await import(FHC_JS_DATA_STORAGE_OBJECT.app_root + this.widget.setup.file + '?' + FHC_JS_DATA_STORAGE_OBJECT.fhcomplete_build_version)).default;
this.$options.components["widget" + this.widget.widget_id] = component;
this.component = "widget" + this.widget.widget_id;
this.arguments = { ...this.widget.arguments, ...this.config };
+4 -3
View File
@@ -12,6 +12,7 @@ import { existsSync } from 'node:fs';
import terser from '@rollup/plugin-terser';
import json from '@rollup/plugin-json';
const buildtimestamp = new Date().toISOString().replace(/[-T:]/g, '').substr(0,14);
const fhcbasepath = import.meta.dirname;
let apps = {};
let curapp = null;
@@ -40,7 +41,7 @@ function FhcResolver () {
if( source.includes('index.ci.php') ) {
//console.log('source: ' + source + ' curapp: ' + curapp + ' importer: ' + importer);
let source_abs = fhcbasepath + '/' + source.replace(/(\.\.\/)+/, '');
let source_rel = path.relative(path.dirname(curapp), source_abs);
let source_rel = path.relative(path.dirname(curapp), source_abs) + '?' + buildtimestamp;
//console.log('SOURCE_ABS:' + source_abs + 'APP: ' + curapp + 'SOURCE_REL: ' + source_rel);
return { id: source_rel, external: 'relative'};
}
@@ -52,7 +53,7 @@ function FhcResolver () {
if(source_abs.match(/\/FHC-Core-[^\/]+\/public\//)) {
source_abs = fhcbasepath + source_abs.replace(/^.+?\/(FHC-Core-[^\/]+)\/public\//, '/public/extensions/$1/');
}
let source_rel = path.relative(path.dirname(curapp), source_abs);
let source_rel = path.relative(path.dirname(curapp), source_abs) + '?' + buildtimestamp;
//console.log('SOURCE_ABS:' + source_abs + 'APP: ' + curapp + 'SOURCE_REL: ' + source_rel);
return { id: source_rel, external: 'relative'};
}
@@ -168,7 +169,7 @@ export default globSync('public/**/js/apps/**/*.js', {follow: false, realpath: f
sourceMap: true
})
];
const vuedatepicker = path.relative(path.dirname(outputfile), basepath + 'components/vueDatepicker.js.php');
const vuedatepicker = path.relative(path.dirname(outputfile), basepath + 'components/vueDatepicker.js.php?' + buildtimestamp);
//console.log(vuedatepicker);
return {
input: tmp,