feat: log loaded config and add catch
This commit is contained in:
parent
4640b6e5cf
commit
063bc0567b
1 changed files with 5 additions and 2 deletions
|
@ -22,14 +22,17 @@ import { eventHandler } from 'h3'
|
||||||
export function useMcFlyRoute({ storage }) {
|
export function useMcFlyRoute({ storage }) {
|
||||||
return eventHandler(async (event) => {
|
return eventHandler(async (event) => {
|
||||||
const { path } = event
|
const { path } = event
|
||||||
const { config } = await loadConfig({
|
const loadedConfig = await loadConfig({
|
||||||
name: 'mcfly',
|
name: 'mcfly',
|
||||||
configFile: 'mcfly.config',
|
configFile: 'mcfly.config',
|
||||||
})
|
})
|
||||||
|
const config = loadConfig.config ?? {
|
||||||
|
components: 'js',
|
||||||
|
}
|
||||||
const { components: componentType } = config
|
const { components: componentType } = config
|
||||||
let html = await getHtml(path, storage)
|
let html = await getHtml(path, storage)
|
||||||
|
|
||||||
console.log('[INFO]: Mcfly Config', config)
|
console.log('[INFO]: Mcfly Config', loadedConfig)
|
||||||
|
|
||||||
if (html) {
|
if (html) {
|
||||||
const transforms = [evaluateServerScript, deleteServerScripts]
|
const transforms = [evaluateServerScript, deleteServerScripts]
|
||||||
|
|
Loading…
Reference in a new issue