message: fix(plugins/antd): don't throw error on register stage when antd not found
diff: @@ -5,12 +5,15 @@ import { resolveProjectDep } from './utils/resolveProjectDep';
  import { withTmpPath } from './utils/withTmpPath';
  export default (api: IApi) => {
  - const pkgPath =
  + let pkgPath: string;
  + try {
  + pkgPath =
  resolveProjectDep({
  pkg: api.pkg,
  cwd: api.cwd,
  dep: 'antd',
  }) || dirname(require.resolve('antd/package.json'));
  + } catch (e) {}
  api.describe({
  config: {
  @@ -30,7 +33,14 @@ export default (api: IApi) => {
  enableBy: api.EnableBy.config,
  });
  + function checkPkgPath() {
  + if (!pkgPath) {
  + throw new Error(`Can't find antd package. Please install antd first.`);
  + }
  + }
  +
  api.modifyAppData((memo) => {
  + checkPkgPath();
  const version = require(`${pkgPath}/package.json`).version;
  memo.antd = {
  pkgPath,
  @@ -40,6 +50,8 @@ export default (api: IApi) => {
  });
  api.modifyConfig((memo) => {
  + checkPkgPath();
  +
  // antd import
  memo.alias.antd = pkgPath;
  