diff --git a/vike/node/cli/index.ts b/vike/node/cli/index.ts index c504d0ff8e1..9a8c881addd 100644 --- a/vike/node/cli/index.ts +++ b/vike/node/cli/index.ts @@ -1,12 +1,11 @@ // TODO/v1-release: remove this file -import { prerender as prerenderOriginal } from '../prerender/index.js' +export { runPrerenderFromAPI as prerender } from '../prerender/runPrerender.js' + import { assertWarning } from '../../utils/assert.js' -export const prerender: typeof prerenderOriginal = (options) => { - assertWarning( - false, - "`import { prerender } from 'vike/cli'` is deprecated in favor of `import { prerender } from 'vike/prerender'``", - { onlyOnce: true, showStackTrace: true } - ) - return prerenderOriginal(options) -} +import pc from '@brillout/picocolors' +assertWarning( + false, + `${pc.cyan("import { prerender } from 'vike/cli'")} is deprecated in favor of ${pc.cyan("import { prerender } from 'vike/api'")}`, + { onlyOnce: true } +) diff --git a/vike/node/prerender/index.ts b/vike/node/prerender/index.ts index c6d487dd5fe..ef7650ec687 100644 --- a/vike/node/prerender/index.ts +++ b/vike/node/prerender/index.ts @@ -1 +1,11 @@ +// TODO/v1-release: remove this file + export { runPrerenderFromAPI as prerender } from './runPrerender.js' + +import { assertWarning } from './utils.js' +import pc from '@brillout/picocolors' +assertWarning( + false, + `${pc.cyan("import { prerender } from 'vike/prerender'")} is deprecated in favor of ${pc.cyan("import { prerender } from 'vike/api'")}`, + { onlyOnce: true } +)