Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
nitedani committed Feb 10, 2024
1 parent 56415b4 commit c1c0b95
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
11 changes: 1 addition & 10 deletions vike/node/api/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export type { InlineCliConfig }
export { resolveConfig }
export { isCliCall, setCliCall }
export { setInlineCliConfig }

import type { InlineConfig } from 'vite'
import type { ConfigVikeResolved, ConfigVikeUserProvided } from '../../shared/ConfigVike.js'
Expand Down Expand Up @@ -63,12 +62,4 @@ async function resolveConfig(config: InlineCliConfig, command: 'build' | 'serve'
let isCliCall = false
function setCliCall() {
isCliCall = true
}

function setInlineCliConfig(config: InlineCliConfig) {
// skip the api layer of the prerender function and directly pass the prerender config to vike
// so the exposed prerender api can be preserved
config.vite ??= {}
//@ts-ignore
config.vite._vike_cli = { prerender: config.prerender }
}
}
2 changes: 0 additions & 2 deletions vike/node/cli/bin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ cli.option('-c, --config [string]', `[string] use specified config`)
cli.command('prerender', 'Pre-render the HTML of your pages').action(async (options) => {
const config = parseConfigString(options.config)
const { prerender } = await import('../api/prerender.js')
const { setInlineCliConfig } = await import('../api/utils.js')
setInlineCliConfig(config)
await prerender({
viteConfig: config.vite
Expand All @@ -32,7 +31,6 @@ cli

cli.command('build', 'Build for production').action(async (options) => {
const config = parseConfigString(options.config)
const { setInlineCliConfig } = await import('../api/utils.js')
setInlineCliConfig(config)
const { build } = await import('../api/build.js')
return build(config)
Expand Down

0 comments on commit c1c0b95

Please sign in to comment.