Skip to content
Snippets Groups Projects
Commit 74426b92 authored by Julian's avatar Julian
Browse files

Merge remote-tracking branch 'origin/759-finalise-vuetify-app-as-spa' into...

Merge remote-tracking branch 'origin/759-finalise-vuetify-app-as-spa' into 759-finalise-vuetify-app-as-spa
parents bb8eac61 049ee418
No related branches found
No related tags found
1 merge request!1123Resolve "Finalise Vuetify app as SPA"
Pipeline #108467 failed
......@@ -97,6 +97,22 @@ function generateAppImporter(appDetails) {
return code;
}
/**
* Generate a mapping of esbuild import aliases for apps.
*
* App code locations are discovered by the `aleksis-admin` vite wrapper and passed
* in the django_values hints.
*/
function generateAppAliases(appDetails) {
let aliases = { "aleksis.core": django_values.coreAssetDir };
for (const [appPackage, appMeta] of Object.entries(appDetails)) {
aliases[appPackage] = appMeta.assetDir;
}
return aliases;
}
export default defineConfig({
// root must always be the base directory of the AlekSIS-Core source tree
// Changing this will mangle the manifest key of the entrypoint!
......@@ -293,6 +309,8 @@ export default defineConfig({
alias: {
"@": path.resolve(django_values.node_modules),
vue: path.resolve(django_values.node_modules + "/vue/dist/vue.esm.js"),
// Add aliases for every app using their package name
...generateAppAliases(django_values.appDetails),
},
},
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment