Closed empz closed 5 years ago
Here's the bundle map.
Hmm, the bundle looks ok to me. If it was importing everything then the .less
boxes would be much bigger.
The less variables are part of the webpack config, and they affect the Less source files directly when they are being compiled into CSS. And it looks like the bundle-import-plugin
and less-loader
plugins are working, because you're loading the index.less
files (and not their compiled CSS.)
Did you see the section about needing to restart webpack whenever you make changes to the variables?
Oh I saw you are also importing bootstrap.min.css
in static/js/4.chunk.js
. Maybe this CSS is overriding the Ant Design theme? (Ant Design doesn't use Bootstrap)
Thanks for the quick reply!
I'm sorry, I was messing it up myself. Still trying to migrate from boostrap to antd and into this setup and got lost. But I got it working.
Thanks!
Oh great, glad to hear you figured it out!
I have a CRA 2.1.1 app and I've followed your setup step by step. I'm using your production-version of
craco.config.js
but without the pract plugin.I'm only using a few components from antd. Those components are rendered after some authentication process is completed. As soon as those components are rendered, all the antd stylesheets are injected in the document and overriding my variables.
So, it seems
babel-plugin-import
is not properly working because it should only load the css related to the components I'm using right? Also, the variables are overwritten when the styles are injected.Any ideas?