1

I want to load local 3rd party css (eg font-awesome icons) as part of my styleguide. As many components uses the same CSS, I want it to be loaded automatically and included as part of the static build.

I settled on using mini-css-extract-plugin to accompolish this, but styleguidist maintainer @sapegin basically told me that I have no idea what I am doing and stop complaining to him without providing any help. So I was hoping the stack-overflow community would give me a hand in pointing out what is the correct way:

styleguidist discussion: https://github.com/styleguidist/react-styleguidist/pull/985#issuecomment-389422909

My github repo demonstrating the three ways of doing it: https://github.com/bugzpodder/styleguidist-local-css-example/tree/master

master: uses mini-css-extract-plugin + require config, build and devserver works as expected.

require: I couldn't get it to work without mini-css-extract-plugin

template: devserver works, but build does not. The only workwaround I can think of is to use publicPath and copy the css there, but publicPath isn't allowed unless you dangerouslyupdatewebpackconfig https://github.com/styleguidist/react-styleguidist/pull/956

bugzpodder
  • 29
  • 1
  • 6

0 Answers0