fix: config

This commit is contained in:
cha0s 2024-02-03 01:57:51 -06:00
parent 88c4f13f74
commit 83df532e97
2 changed files with 13 additions and 12 deletions

View File

@ -39,8 +39,7 @@ module.exports = class Build extends Flecks {
static async buildRuntime(originalConfig, platforms, flecks = {}) {
const cleanConfig = JSON.parse(JSON.stringify(originalConfig));
// Dealias the config keys.
const dealiasedConfig = this.environmentConfiguration(
Object.fromEntries(
const dealiasedConfig = Object.fromEntries(
Object.entries(cleanConfig)
.map(([maybeAliasedPath, config]) => {
const index = maybeAliasedPath.indexOf(':');
@ -49,7 +48,6 @@ module.exports = class Build extends Flecks {
config,
];
}),
),
);
const resolver = new Resolver({root: FLECKS_CORE_ROOT});
const {paths, roots} = await explicate({
@ -59,7 +57,9 @@ module.exports = class Build extends Flecks {
importer: (request) => require(request),
});
const runtime = {
config: Object.fromEntries(paths.map((path) => [path, dealiasedConfig[path] || {}])),
config: this.environmentConfiguration(
Object.fromEntries(paths.map((path) => [path, dealiasedConfig[path] || {}])),
),
flecks: Object.fromEntries(paths.map((path) => [
path,
flecks[path] || roots[path]?.bootstrap || {},

View File

@ -22,4 +22,5 @@ export const hooks = {
*/
ssr: true,
}),
'@flecks/web.config': async (req, flecks) => flecks.get('@flecks/react'),
};