refactor(vite): use rollup types re-exported from vite (#20011)

This commit is contained in:
Daniel Roe 2023-03-31 10:56:10 +01:00 committed by GitHub
parent 8c2ca23c55
commit fe04bf0f7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View File

@ -3,12 +3,11 @@ import { join, resolve } from 'pathe'
import * as vite from 'vite'
import vuePlugin from '@vitejs/plugin-vue'
import viteJsxPlugin from '@vitejs/plugin-vue-jsx'
import type { ServerOptions } from 'vite'
import type { ServerOptions, BuildOptions } from 'vite'
import { logger } from '@nuxt/kit'
import { getPort } from 'get-port-please'
import { joinURL, withoutLeadingSlash } from 'ufo'
import { defu } from 'defu'
import type { OutputOptions } from 'rollup'
import { defineEventHandler } from 'h3'
import type { ViteConfig } from '@nuxt/schema'
import { cacheDirPlugin } from './plugins/cache-dir'
@ -99,7 +98,7 @@ export async function buildClient (ctx: ViteBuildContext) {
output: {
chunkFileNames: ctx.nuxt.options.dev ? undefined : withoutLeadingSlash(join(ctx.nuxt.options.app.buildAssetsDir, '[name].[hash].js')),
entryFileNames: ctx.nuxt.options.dev ? 'entry.js' : withoutLeadingSlash(join(ctx.nuxt.options.app.buildAssetsDir, '[name].[hash].js'))
} as OutputOptions
} satisfies NonNullable<BuildOptions['rollupOptions']>['output']
}) as any
if (clientConfig.server && clientConfig.server.hmr !== false) {

View File

@ -1,5 +1,5 @@
import { dirname, isAbsolute, join, resolve } from 'pathe'
import type { Plugin } from 'rollup'
import type { Plugin } from 'vite'
const PREFIX = 'virtual:nuxt:'