feat: remove manual copy during build cmd
This commit is contained in:
parent
3a3249f361
commit
5af6747c29
1 changed files with 0 additions and 12 deletions
|
@ -12,7 +12,6 @@ import {
|
||||||
} from 'nitropack'
|
} from 'nitropack'
|
||||||
import { fileURLToPath } from 'node:url'
|
import { fileURLToPath } from 'node:url'
|
||||||
import { getMcFlyConfig, getNitroConfig } from '../../get-nitro-config.js'
|
import { getMcFlyConfig, getNitroConfig } from '../../get-nitro-config.js'
|
||||||
import { copyFileSync } from 'node:fs'
|
|
||||||
|
|
||||||
async function _build(args) {
|
async function _build(args) {
|
||||||
consola.start('Building project...')
|
consola.start('Building project...')
|
||||||
|
@ -22,8 +21,6 @@ async function _build(args) {
|
||||||
const [mcflyConfig, appConfigFile] = await getMcFlyConfig()
|
const [mcflyConfig, appConfigFile] = await getMcFlyConfig()
|
||||||
const nitroConfig = await getNitroConfig(mcflyConfig)
|
const nitroConfig = await getNitroConfig(mcflyConfig)
|
||||||
|
|
||||||
console.log('>>> preset arg', args.preset)
|
|
||||||
|
|
||||||
const nitro = await createNitro({
|
const nitro = await createNitro({
|
||||||
rootDir,
|
rootDir,
|
||||||
dev: false,
|
dev: false,
|
||||||
|
@ -44,15 +41,6 @@ async function _build(args) {
|
||||||
|
|
||||||
nitro.options.runtimeConfig.appConfigFile = appConfigFile
|
nitro.options.runtimeConfig.appConfigFile = appConfigFile
|
||||||
|
|
||||||
nitro.hooks.hook('compiled', () => {
|
|
||||||
console.log('>>> Nitro compiled', rootDir)
|
|
||||||
|
|
||||||
// TODO: match file for mcfly.config.*
|
|
||||||
const mcflyConfigPath = resolve(rootDir, './mcfly.config.mjs')
|
|
||||||
const distPath = resolve(rootDir, './dist/mcfly.config.mjs')
|
|
||||||
copyFileSync(mcflyConfigPath, distPath)
|
|
||||||
})
|
|
||||||
|
|
||||||
await prepare(nitro)
|
await prepare(nitro)
|
||||||
await copyPublicAssets(nitro)
|
await copyPublicAssets(nitro)
|
||||||
await prerender(nitro)
|
await prerender(nitro)
|
||||||
|
|
Loading…
Reference in a new issue