mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
fix(ts): add type definition for functional babel.presets (#5785)
This commit is contained in:
parent
ec391b9f0e
commit
59071e4c6d
12
packages/config/types/build.d.ts
vendored
12
packages/config/types/build.d.ts
vendored
@ -8,7 +8,7 @@ import {
|
||||
Options as WebpackOptions,
|
||||
Plugin as WebpackPlugin
|
||||
} from 'webpack'
|
||||
import { TransformOptions } from '@babel/core'
|
||||
import { TransformOptions, PluginItem } from '@babel/core'
|
||||
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'
|
||||
import { Options as WebpackDevMiddlewareOptions } from 'webpack-dev-middleware'
|
||||
import { Options as WebpackHotMiddlewareOptions } from 'webpack-hot-middleware'
|
||||
@ -18,9 +18,17 @@ import { TerserPluginOptions } from 'terser-webpack-plugin'
|
||||
|
||||
type NuxtConfigurationLoaders = any // TBD
|
||||
|
||||
interface NuxtBabelPresetEnv {
|
||||
isServer: boolean
|
||||
}
|
||||
|
||||
interface NuxtBabelOptions extends Pick<TransformOptions, Exclude<keyof TransformOptions, 'presets'>> {
|
||||
presets?: ((env: NuxtBabelPresetEnv, defaultPreset: [string, object]) => PluginItem[] | void) | PluginItem[] | null
|
||||
}
|
||||
|
||||
export interface NuxtConfigurationBuild {
|
||||
analyze?: BundleAnalyzerPlugin.Options | boolean
|
||||
babel?: TransformOptions
|
||||
babel?: NuxtBabelOptions
|
||||
cache?: boolean
|
||||
crossorigin?: string
|
||||
cssSourceMap?: boolean
|
||||
|
Loading…
Reference in New Issue
Block a user