I have
import 'semantic-ui-css/semantic.min.css'
in index.js
, as instructed by Semantic UI.
Before I did yarn eject
(to enable CSS modules with create-react-app
) everything worked fine, but as soon as I did I got the following error:
Module not found: Can't resolve 'themes/default/assets/fonts/icons.eot' in '[MY_PROJECT_DIR]/node_modules/semantic-ui-css'
I thought that it might be an issue with Webpack's loaders' not dealing with font files, so I found this:
{
test: /\.(eot|woff|woff2|ttf|svg|png|jpg)$/,
loader: 'url-loader?limit=30000&name=[name]-[hash].[ext]'
}
I added it to my webpack.config.dev.js
in the rules
array (after the eslint
loader and before the big one with everything else) but nothing changed.
Add the following in the rules section:
Hopes it helps !
I was having the same issue, I solved it by splitting the webpack's css loader rules into 2:
The resulting rules on
webpack.config.dev.js
generated by CRA's eject script, would look like this:I don't think this answer is optimal, but certainly worked for me. Good luck