mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 23:22:02 +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 { AssetOptions } from './rollup/plugins/assets'
|
||||||
import type { ServerMiddleware } from './server/middleware'
|
import type { ServerMiddleware } from './server/middleware'
|
||||||
import type { RollupConfig } from './rollup/config'
|
import type { RollupConfig } from './rollup/config'
|
||||||
|
import type { Options as EsbuildOptions } from './rollup/plugins/esbuild'
|
||||||
|
|
||||||
export interface NitroHooks {
|
export interface NitroHooks {
|
||||||
'nitro:document': (htmlTemplate: { src: string, contents: string, dst: string, compiled: string }) => void
|
'nitro:document': (htmlTemplate: { src: string, contents: string, dst: string, compiled: string }) => void
|
||||||
@ -31,6 +32,9 @@ export interface NitroContext {
|
|||||||
node: boolean
|
node: boolean
|
||||||
preset: string
|
preset: string
|
||||||
rollupConfig?: RollupConfig
|
rollupConfig?: RollupConfig
|
||||||
|
esbuild?: {
|
||||||
|
options?: EsbuildOptions
|
||||||
|
}
|
||||||
moduleSideEffects: string[]
|
moduleSideEffects: string[]
|
||||||
renderer: string
|
renderer: string
|
||||||
serveStatic: boolean
|
serveStatic: boolean
|
||||||
|
@ -158,7 +158,8 @@ export const getRollupConfig = (nitroContext: NitroContext) => {
|
|||||||
// ESBuild
|
// ESBuild
|
||||||
rollupConfig.plugins.push(esbuild({
|
rollupConfig.plugins.push(esbuild({
|
||||||
target: 'es2019',
|
target: 'es2019',
|
||||||
sourceMap: true
|
sourceMap: true,
|
||||||
|
...nitroContext.esbuild?.options
|
||||||
}))
|
}))
|
||||||
|
|
||||||
// Dynamic Require Support
|
// Dynamic Require Support
|
||||||
|
Loading…
Reference in New Issue
Block a user