Skip to content

Commit

Permalink
refactor: dynamic import vite
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Aug 16, 2024
1 parent cad28d4 commit 1119b31
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

import { type UnpluginInstance, createUnplugin } from 'unplugin'
import { createFilter } from '@rollup/pluginutils'
import { type ModuleNode, type ViteDevServer, createServer } from 'vite'
import { ViteNodeServer } from 'vite-node/server'
import { ViteNodeRunner } from 'vite-node/client'
import { installSourcemapsSupport } from 'vite-node/source-map'
import { type Options, resolveOptions } from './core/options'
import { transformMacros } from './core'
import type { ModuleNode, ViteDevServer } from 'vite'

export type { Options, MacroContext } from './core'

Expand Down Expand Up @@ -47,6 +47,7 @@ const plugin: UnpluginInstance<Options | undefined, false> = createUnplugin<
}

async function initServer() {
const { createServer } = await import('vite')
const server = await createServer({
...options.viteConfig,
optimizeDeps: {
Expand Down

0 comments on commit 1119b31

Please sign in to comment.