M
M
Michael R.2018-10-09 11:33:33
webpack
Michael R., 2018-10-09 11:33:33

How to include postcss-merge-rules in webpack?

Greetings!
Tell me, how to correctly connect the postcss-merge-rules library for wepback ? I would like to achieve a similar gluing of classes and css properties for identical elements.
I suppose that this plugin should be connected here, but how exactly should it be connected? Part of code from webpack.config.js:

{
    	loader: 'postcss-loader',
    	options: {
    		ident: 'postcss',
    		sourceMap: !isProduction,
    		plugins: (() => {
    			return isProduction ? [
    				require('autoprefixer')(),
    				require('cssnano')({
    					preset: ['default', {
    						minifySelectors: true
    					}]
    				})
    			] : []
    		})()
    	}
    }

Long googling and sorting through various options for connecting this library did not give any results ...
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Yarkov, 2018-10-09
@Mike_Ro

Did you try to follow the link and see an example of using postcss? Yet it is written.
https://github.com/postcss/postcss#usage
What is not clear about this?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question