Skip to content
How to reduce your umi project with ant-design icons.
JavaScript TypeScript
Branch: master
Clone or download
Latest commit 9e93645 Aug 10, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs update picture Sep 11, 2018
src use whole antd icons in need Sep 11, 2018
.editorconfig reduce bundle size Sep 10, 2018
.gitignore update ignore Sep 10, 2018
.prettierrc reduce bundle size Sep 10, 2018
.umirc.js pretty export Sep 11, 2018
ReadMe.md
package.json pretty export Sep 11, 2018
tsconfig.json update tsconfig Sep 11, 2018

ReadMe.md

Reduce Antd icons bundle size

See related issue.

Before After
before after
before after

Config alias

See the whole file src/icons.js

// src/icons.js

// export what you need
export {
  default as SmileOutline
} from '@ant-design/icons/lib/outline/SmileOutline';
export {
  default as MehOutline
} from '@ant-design/icons/lib/outline/MehOutline';

// export what antd other components need
export {
  default as CloseOutline
} from '@ant-design/icons/lib/outline/CloseOutline';
// and other icons...
// .umirc.js
export default {
  alias: {
    '@ant-design/icons/lib/dist$': path.resolve(__dirname, './src/icons.js')
  }
};
// vue.config.js
module.exports = {
  configureWebpack: {
    resolve: {
      alias: {
        "@ant-design/icons/lib/dist$": path.resolve(__dirname, "./src/icons.js")
      }
    }
  }
};
You can’t perform that action at this time.