项目作者: marceickhoff

项目描述 :
Extension for Laravel Mix that provides clean-css support.
高级语言: JavaScript
项目地址: git://github.com/marceickhoff/laravel-mix-clean-css.git
创建时间: 2019-11-29T08:16:31Z
项目社区:https://github.com/marceickhoff/laravel-mix-clean-css

开源协议:MIT License

下载


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

  1. npm i -D laravel-mix-clean-css

Usage

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

  1. const mix = require('laravel-mix');
  2. require('laravel-mix-clean-css');
  3. mix
  4. .sass('src/app.scss', 'dist')
  5. .sass('src/app.sass', 'dist')
  6. .less('src/app.less', 'dist')
  7. .stylus('src/app.styl', 'dist')
  8. // Run clean-css on all stylesheets
  9. .cleanCss({
  10. level: 2,
  11. format: mix.inProduction() ? false : 'beautify' // Beautify only in dev mode
  12. })
  13. // Run clean-css only on one specific stylesheet
  14. .cleanCss({
  15. // ...
  16. }, 'src/app.scss')
  17. // Run clean-css only on multiple specific stylesheets
  18. .cleanCss({
  19. // ...
  20. }, [
  21. 'src/app.scss',
  22. 'src/app.sass',
  23. ])

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