UNPKG

vike

Version:

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

19 lines (18 loc) 741 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isDevCheck = isDevCheck; exports.applyDev = applyDev; exports.applyPreview = applyPreview; const assert_js_1 = require("./assert.js"); function isDevCheck(configEnv) { const { isPreview, command } = configEnv; // `assertVersion('Vite', version, '5.1.0')` isn't enough: https://github.com/vitejs/vite/pull/19355 (0, assert_js_1.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); }