feat(core): add mcfly nitro config to core
This commit is contained in:
parent
96833fd70b
commit
749a4e90d5
4 changed files with 36 additions and 2 deletions
|
@ -12,7 +12,7 @@ import {
|
||||||
prerender,
|
prerender,
|
||||||
} from 'nitropack'
|
} from 'nitropack'
|
||||||
import { fileURLToPath } from 'node:url'
|
import { fileURLToPath } from 'node:url'
|
||||||
import { nitroConfig as mcflyNitroConfig } from '@mcflyjs/config/nitro-config.js'
|
import { nitroConfig as mcflyNitroConfig } from '@mcflyjs/core/runtime'
|
||||||
|
|
||||||
async function _build(args) {
|
async function _build(args) {
|
||||||
consola.start('Building project...')
|
consola.start('Building project...')
|
||||||
|
|
|
@ -15,7 +15,7 @@ import { resolve } from 'pathe'
|
||||||
import { loadConfig } from 'c12'
|
import { loadConfig } from 'c12'
|
||||||
import { fileURLToPath } from 'node:url'
|
import { fileURLToPath } from 'node:url'
|
||||||
import { dirname } from 'pathe'
|
import { dirname } from 'pathe'
|
||||||
import { nitroConfig as mcflyNitroConfig } from '@mcflyjs/config/nitro-config.js'
|
import { nitroConfig as mcflyNitroConfig } from '@mcflyjs/core/runtime'
|
||||||
|
|
||||||
const hmrKeyRe = /^runtimeConfig\.|routeRules\./
|
const hmrKeyRe = /^runtimeConfig\.|routeRules\./
|
||||||
const __filename = fileURLToPath(import.meta.url)
|
const __filename = fileURLToPath(import.meta.url)
|
||||||
|
|
|
@ -4,3 +4,4 @@ export { getFiles } from './get-files.mjs'
|
||||||
export { hooks } from './hooks.mjs'
|
export { hooks } from './hooks.mjs'
|
||||||
export { injectCustomElements } from './inject-elements.mjs'
|
export { injectCustomElements } from './inject-elements.mjs'
|
||||||
export { injectHtmlFragments } from './inject-fragments.mjs'
|
export { injectHtmlFragments } from './inject-fragments.mjs'
|
||||||
|
export { nitroConfig } from './nitro-config.js'
|
||||||
|
|
33
packages/core/runtime/nitro-config.js
Normal file
33
packages/core/runtime/nitro-config.js
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
/**
|
||||||
|
* @typedef {import('nitropack').NitroConfig} NitroConfig
|
||||||
|
* @type {NitroConfig}
|
||||||
|
*/
|
||||||
|
export const nitroConfig = {
|
||||||
|
framework: {
|
||||||
|
name: 'McFly',
|
||||||
|
},
|
||||||
|
compatibilityDate: '2024-12-08',
|
||||||
|
srcDir: 'src',
|
||||||
|
apiDir: 'api',
|
||||||
|
devServer: {
|
||||||
|
watch: ['./pages', './components', './api'],
|
||||||
|
},
|
||||||
|
serverAssets: [
|
||||||
|
{
|
||||||
|
baseName: 'pages',
|
||||||
|
dir: './pages',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
baseName: 'components',
|
||||||
|
dir: './components',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
imports: {
|
||||||
|
presets: [
|
||||||
|
{
|
||||||
|
from: 'web-component-base',
|
||||||
|
imports: ['WebComponent', 'html', 'attachEffect'],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
}
|
Loading…
Reference in a new issue