Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ts): add type definition for functional babel.presets #5785

Merged
merged 5 commits into from
May 22, 2019
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions packages/config/types/build.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -18,9 +18,17 @@ import { TerserPluginOptions } from 'terser-webpack-plugin'

type NuxtConfigurationLoaders = any // TBD

interface NuxtBabelPresetEnv {
isServer: boolean;
clarkdo marked this conversation as resolved.
Show resolved Hide resolved
}

interface NuxtBabelOptions extends Pick<TransformOptions, Exclude<keyof TransformOptions, 'presets'>> {
presets?: ((env: NuxtBabelPresetEnv, presets: [string, object | null]) => PluginItem[] | void) | PluginItem[] | null
clarkdo marked this conversation as resolved.
Show resolved Hide resolved
}

export interface NuxtConfigurationBuild {
analyze?: BundleAnalyzerPlugin.Options | boolean
babel?: TransformOptions
babel?: NuxtBabelOptions
cache?: boolean
crossorigin?: string
cssSourceMap?: boolean
Expand Down