gatsby-plugin-antd
Use Ant Design with Gatsby
Install
npm install antd gatsby-plugin-antd --save
How to use
- Include the plugin in your
gatsby-config.js
file.
// in gatsby-config.jsplugins: 'gatsby-plugin-antd'// or if you want to use lessplugins: resolve: 'gatsby-plugin-antd' options: style: true
note: if you are using less then you need to install less
- In your component(s) include the Ant Design component using dynamic imports as suggested here https://ant.design/docs/react/getting-started#Import-on-Demand
// in your component <Button type="primary">Primary</Button>
- It will pull in the component and the relevant css file using babel-plugin-import