0

I have created react component library and I'm using style loader in component library

But at the place where I'm using that library, I need css in one file. Is there any way to do this with extract text plugin ?

Sagar
  • 980
  • 1
  • 11
  • 27

2 Answers2

0

Yes. From the library consumer, import/require the library's style sheet, and configure the consumer's Webpack configuration with the extract text plugin.

Connor Clark
  • 671
  • 7
  • 15
0

inside your webpack's module rules, use file loader to output all css to main.min.css file, and refer it inside consuming application.

                use: [{
                    loader: 'file-loader',
                    options: {
                        name: 'css/main.min.css',
                    },
                },
Vijay122
  • 884
  • 8
  • 12