fix(server) proper handle loaders option

This commit is contained in:
Benjamin Wegener
2024-01-20 06:03:07 +00:00
parent 494787dee2
commit 39cee2c135

View File

@@ -25,6 +25,7 @@ export default class LayServer {
for (const key of optionKeys) {
if (!this.options.has(key)) continue;
if (key == 'loaders') continue;
const valueType = typeof this.options.get(key);
if (
typeof options[key] !== 'undefined' &&
@@ -33,6 +34,12 @@ export default class LayServer {
)
this.options.set(key, options[key]);
}
if (options.hasOwnProperty('loaders')) {
if (options.loaders instanceof Map) {
this.loaders = options.loaders;
}
}
}
this.initRouting(options.router);