UNPKG

vike

Version:

The Framework *You* Control - Next.js & Nuxt alternative for unprecedented flexibility and dependability.

19 lines (18 loc) 813 B
export { isDevCheck }; export { applyDev }; export { applyPreview }; import { assertUsage } from './assert.js'; function isDevCheck(configEnv) { const { isPreview, command } = configEnv; // Note that: // - `assertVersion('Vite', version, '5.1.0')` at node/vite/onLoad.ts isn't enough: https://github.com/vitejs/vite/pull/19355 // - We'll eventually be able to make this an assert() instead of assertUsage() once Vike requires a Vite version that supports this.meta.viteVersion assertUsage(typeof isPreview === 'boolean', 'You are using an old Vite version; make sure to use Vite 5.1.0 or above.'); return command === 'serve' && !isPreview; } function applyDev(_, env) { return isDevCheck(env); } function applyPreview(_, env) { return env.command == 'serve' && !isDevCheck(env); }