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 ?
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 ?
Yes. From the library consumer, import/require the library's style sheet, and configure the consumer's Webpack configuration with the extract text plugin.
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',
},
},