Skip to content

Commit

Permalink
fix(schema,vite)!: do not allow configuring vite dev bundler (nuxt#27707
Browse files Browse the repository at this point in the history
)
  • Loading branch information
danielroe authored Jun 19, 2024
1 parent f5ab7eb commit 4d063f1
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 283 deletions.
9 changes: 5 additions & 4 deletions docs/1.getting-started/12.upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -448,10 +448,11 @@ const importName = genSafeVariableName

Four experimental features are no longer configurable in Nuxt 4:

* `treeshakeClientOnly` will be `true` (default since v3.0)
* `configSchema` will be `true` (default since v3.3)
* `polyfillVueUseHead` will be `false` (default since v3.4)
* `respectNoSSRHeader` will be `false` (default since v3.4)
* `experimental.treeshakeClientOnly` will be `true` (default since v3.0)
* `experimental.configSchema` will be `true` (default since v3.3)
* `experimental.polyfillVueUseHead` will be `false` (default since v3.4)
* `experimental.respectNoSSRHeader` will be `false` (default since v3.4)
* `vite.devBundler` is no longer configurable - it will use `vite-node` by default

##### Reasons for Change

Expand Down
6 changes: 0 additions & 6 deletions packages/schema/src/types/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,6 @@ export interface ViteConfig extends Omit<ViteUserConfig, 'publicDir'> {
*/
vueJsx?: VueJsxPluginOptions

/**
* Bundler for dev time server-side rendering.
* @default 'vite-node'
*/
devBundler?: 'vite-node' | 'legacy'

/**
* Warmup vite entrypoint caches on dev startup.
*/
Expand Down
265 changes: 0 additions & 265 deletions packages/vite/src/dev-bundler.ts

This file was deleted.

7 changes: 1 addition & 6 deletions packages/vite/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,5 @@ export async function buildServer (ctx: ViteBuildContext) {
// Initialize plugins
await viteServer.pluginContainer.buildStart({})

if (ctx.config.devBundler !== 'legacy') {
await initViteNodeServer(ctx)
} else {
logger.info('Vite server using legacy server bundler...')
await import('./dev-bundler').then(r => r.initViteDevBundler(ctx, onBuild))
}
await initViteNodeServer(ctx)
}
3 changes: 1 addition & 2 deletions packages/vite/src/vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ export interface ViteBuildContext {
}

export const bundle: NuxtBuilder['bundle'] = async (nuxt) => {
const useAsyncEntry = nuxt.options.experimental.asyncEntry ||
(nuxt.options.vite.devBundler === 'vite-node' && nuxt.options.dev)
const useAsyncEntry = nuxt.options.experimental.asyncEntry || nuxt.options.dev
const entry = await resolvePath(resolve(nuxt.options.appDir, useAsyncEntry ? 'entry.async' : 'entry'))

let allowDirs = [
Expand Down

0 comments on commit 4d063f1

Please sign in to comment.