fix: console error "missing compiler" doing acme
Massimo Melina committed
Nov 20, 2023 at 00:16 UTC
f14dd6cfb706c30c5b136cbd0aa1347da6340cc2
2 files changed
+2
-2
src/config.ts
+1
-1
@@ -86,7 +86,7 @@ export function defineConfig<T, CT=T>(k: string, defaultValue: T, compiler?: Sub
86
else
87
setConfig1(k, v)
88
},
89
- compiled: () => compiled ?? throw_("missing compiler"),
89
+ compiled: () => (compiler ? compiled : throw_("missing compiler")) as CT,
90
}
91
if (compiler)
92
ret.sub((...args) =>
src/plugins.ts
+1
-1
@@ -224,7 +224,7 @@ const serverCode = defineConfig('server_code', '', async (script, { k }) => {
224
})
225
226
let serverCodePlugin: void | Plugin
227
-serverCode.sub(() => serverCode.compiled().then(x => serverCodePlugin = x))
227
+serverCode.sub(() => serverCode.compiled()?.then(x => serverCodePlugin = x))
228
export function mapPlugins<T>(cb:(plugin:Readonly<Plugin>, pluginName:string)=> T, includeServerCode=true) {
229
const entries = Object.entries(plugins)
230
return entries.map(([plName,pl]) => {