Skip to content

Commit

Permalink
fix: webpack-chain types (#2765)
Browse files Browse the repository at this point in the history
* fix: webpack-chain types

* fix: types
  • Loading branch information
ycjcl868 authored and sorrycc committed Jul 8, 2019
1 parent 6292344 commit eacef94
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/umi-build-dev/src/getWebpackConfig.ts
Expand Up @@ -8,7 +8,7 @@ import nodeExternals from 'webpack-node-externals';
const debug = require('debug')('umi-build-dev:getWebpackConfig');

interface IOpts {
ssr?: boolean | IExportSSROpts;
ssr?: IExportSSROpts;
}

export default function(service: IApi, opts: IOpts = {}) {
Expand Down
8 changes: 4 additions & 4 deletions packages/umi-types/config.d.ts
@@ -1,6 +1,6 @@
// https://umijs.org/config/
import { ExternalsElement, Condition } from 'webpack';
import IWebpackChainConfig from 'webpack-chain';
import * as IWebpackChainConfig from 'webpack-chain';
import { IChangeWebpackConfigFunc } from './index';

export type IPlugin<T = any> = string | [string, T];
Expand Down Expand Up @@ -66,9 +66,9 @@ export interface IAFWebpackConfig {
}

type WhitelistOption = string | RegExp;
export interface IExportSSROpts {
export type IExportSSROpts = {
externalWhitelist?: WhitelistOption[];
}
} | boolean;

interface IConfig extends IAFWebpackConfig {
// basic config
Expand All @@ -92,7 +92,7 @@ interface IConfig extends IAFWebpackConfig {
targets?: {
[key: string]: number;
};
ssr?: boolean | IExportSSROpts;
ssr?: IExportSSROpts;
}

export default IConfig;
2 changes: 1 addition & 1 deletion packages/umi-types/index.d.ts
@@ -1,7 +1,7 @@
import 'cheerio';
import IConfig, { IPlugin, IAFWebpackConfig, IRoute } from './config';
import { Stats, Configuration } from 'webpack';
import IWebpackChainConfig from 'webpack-chain';
import * as IWebpackChainConfig from 'webpack-chain';

/**
* System level variable
Expand Down

0 comments on commit eacef94

Please sign in to comment.