Skip to content

Instantly share code, notes, and snippets.

@ndbroadbent
Last active November 13, 2018 19:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ndbroadbent/f7d6a343c5f4976ef4f8fa10a8595bad to your computer and use it in GitHub Desktop.
Save ndbroadbent/f7d6a343c5f4976ef4f8fa10a8595bad to your computer and use it in GitHub Desktop.
create-react-app configuration using craco, for ant.design, Less loader for custom theming, and preact-compat
// UPDATE: I released a craco plugin as an NPM package: https://github.com/ndbroadbent/craco-antd
@ndbroadbent
Copy link
Author

ndbroadbent commented Nov 12, 2018

You can use the craco tool to configure create-react-app without ejecting.

This is the craco.config.js configuration file I'm using for ant.design. I followed the Ant Design docs to set up the babel-import-plugin. I also set up the Less loader, so that I could customize the Ant Design theme, and also to use my own less files. (Code taken from this craco issue.)

I released this as an installable plugin: https://github.com/ndbroadbent/craco-antd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment