laravel-mix-clean-css

1.3.1 • Public • Published

Laravel Mix clean-css

Latest Version on NPM npm Software License

This extension adds support for clean-css to Laravel Mix by using the clean-css-loader.

Installation

npm i -D laravel-mix-clean-css

Usage

Require the extension inside your webpack.mix.js and add clean-css configurations like this:

const mix = require('laravel-mix');
 
require('laravel-mix-clean-css');
 
mix
  .sass('src/app.scss', 'dist')
  .sass('src/app.sass', 'dist')
  .less('src/app.less', 'dist')
  .stylus('src/app.styl', 'dist')
 
  // Run clean-css on all stylesheets
  .cleanCss({
    level: 2,
    format: mix.inProduction() ? false : 'beautify' // Beautify only in dev mode
  })
 
  // Run clean-css only on one specific stylesheet
  .cleanCss({
    // ...
  }, 'src/app.scss')
 
  // Run clean-css only on multiple specific stylesheets
  .cleanCss({
    // ...
  }, [
    'src/app.scss',
    'src/app.sass',
  ])

For more information about clean-css configurations please refer to their documentation.

Package Sidebar

Install

npm i laravel-mix-clean-css

Weekly Downloads

23

Version

1.3.1

License

MIT

Unpacked Size

5.62 kB

Total Files

4

Last publish

Collaborators

  • marceickhoff