Skip to content

Commit

Permalink
fix: re-implement workaround for legacy plugin (fix #1154)
Browse files Browse the repository at this point in the history
  • Loading branch information
brillout committed Feb 27, 2024
1 parent b177ba7 commit 2305d5b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions vike/node/plugin/plugins/autoFullBuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import type { ConfigVikeResolved } from '../../../shared/ConfigVike.js'
import { isViteCliCall, getViteConfigFromCli } from '../shared/isViteCliCall.js'
import pc from '@brillout/picocolors'
import { logErrorHint } from '../../runtime/renderPage/logErrorHint.js'
import { manifestTempFile } from './buildConfig.js'

let forceExit = false

Expand Down Expand Up @@ -65,10 +66,11 @@ async function triggerFullBuild(
) {
if (config.build.ssr) return // already triggered
if (isDisabled(configVike)) return
/* Is this @vitejs/plugin-legacy workaround still needed? Should we re-implement it?
// vike.json missing => it isn't a `$ vite build` call (e.g. @vitejs/plugin-legacy calls Vite's build() API) => skip
if (!bundle['vike.json']) return
*/
// Workaround for @vitejs/plugin-legacy
// - The legacy plugin triggers its own Rollup build for the client-side.
// - The legacy plugin doesn't generate a manifest => we can use that to detect the legacy plugin build.
// - Issue & reproduction: https://github.com/vikejs/vike/issues/1154#issuecomment-1965954636
if (!bundle[manifestTempFile]) return

const configFromCli = !isViteCliCall() ? null : getViteConfigFromCli()
const configInline = {
Expand Down

0 comments on commit 2305d5b

Please sign in to comment.