mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 09:27:13 +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,
|
Options as WebpackOptions,
|
||||||
Plugin as WebpackPlugin
|
Plugin as WebpackPlugin
|
||||||
} from 'webpack'
|
} from 'webpack'
|
||||||
import { TransformOptions } from '@babel/core'
|
import { TransformOptions, PluginItem } from '@babel/core'
|
||||||
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'
|
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'
|
||||||
import { Options as WebpackDevMiddlewareOptions } from 'webpack-dev-middleware'
|
import { Options as WebpackDevMiddlewareOptions } from 'webpack-dev-middleware'
|
||||||
import { Options as WebpackHotMiddlewareOptions } from 'webpack-hot-middleware'
|
import { Options as WebpackHotMiddlewareOptions } from 'webpack-hot-middleware'
|
||||||
@ -18,9 +18,17 @@ import { TerserPluginOptions } from 'terser-webpack-plugin'
|
|||||||
|
|
||||||
type NuxtConfigurationLoaders = any // TBD
|
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 {
|
export interface NuxtConfigurationBuild {
|
||||||
analyze?: BundleAnalyzerPlugin.Options | boolean
|
analyze?: BundleAnalyzerPlugin.Options | boolean
|
||||||
babel?: TransformOptions
|
babel?: NuxtBabelOptions
|
||||||
cache?: boolean
|
cache?: boolean
|
||||||
crossorigin?: string
|
crossorigin?: string
|
||||||
cssSourceMap?: boolean
|
cssSourceMap?: boolean
|
||||||
|
Loading…
Reference in New Issue
Block a user