mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
feat(nitro): support esbuild options config (#550)
This commit is contained in:
parent
317fc55539
commit
a137d2e5ec
@ -12,6 +12,7 @@ import type { StorageOptions } from './rollup/plugins/storage'
|
||||
import type { AssetOptions } from './rollup/plugins/assets'
|
||||
import type { ServerMiddleware } from './server/middleware'
|
||||
import type { RollupConfig } from './rollup/config'
|
||||
import type { Options as EsbuildOptions } from './rollup/plugins/esbuild'
|
||||
|
||||
export interface NitroHooks {
|
||||
'nitro:document': (htmlTemplate: { src: string, contents: string, dst: string, compiled: string }) => void
|
||||
@ -31,6 +32,9 @@ export interface NitroContext {
|
||||
node: boolean
|
||||
preset: string
|
||||
rollupConfig?: RollupConfig
|
||||
esbuild?: {
|
||||
options?: EsbuildOptions
|
||||
}
|
||||
moduleSideEffects: string[]
|
||||
renderer: string
|
||||
serveStatic: boolean
|
||||
|
@ -158,7 +158,8 @@ export const getRollupConfig = (nitroContext: NitroContext) => {
|
||||
// ESBuild
|
||||
rollupConfig.plugins.push(esbuild({
|
||||
target: 'es2019',
|
||||
sourceMap: true
|
||||
sourceMap: true,
|
||||
...nitroContext.esbuild?.options
|
||||
}))
|
||||
|
||||
// Dynamic Require Support
|
||||
|
Loading…
Reference in New Issue
Block a user