Skip to content

A Webpack plugin to merge media query and minimize CSS assets.

Notifications You must be signed in to change notification settings

asyalas/css-asserts-minimize-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Css Asserts Minimize Plugin

A Webpack plugin to merge media query and minimize CSS assets.

What does the plugin do?

It will search for CSS assets during the Webpack build and will merge the same media query and optimize \ minimize the CSS by cssnano , so that you can ues css percompiler to write media query in css styles and don't worry about writing so much the same media queries and making css assets too large.

Install

npm i css-asserts-minimize-plugin -D

Basic Usage

// webpack.config.js
  module.exports = {
	...
  plugins: [
    new CssAssertsMinimizePlugin(),
       
// webpack.config.js
  module.exports = {
	...
  plugins: [
    new CssAssertsMinimizePlugin({
          preset: ['default', {
              discardComments: {
                  removeAll: true,
              },
          }]
        }),
       

the config is the same as cssnano config

About

A Webpack plugin to merge media query and minimize CSS assets.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published