https://github.com/marceickhoff/laravel-mix-clean-css
Extension for Laravel Mix that provides clean-css support.
https://github.com/marceickhoff/laravel-mix-clean-css
clean-css laravel-mix laravel-mix-extension laravel-mix-plugin npm-package webpack
Last synced: 2 months ago
JSON representation
Extension for Laravel Mix that provides clean-css support.
- Host: GitHub
- URL: https://github.com/marceickhoff/laravel-mix-clean-css
- Owner: marceickhoff
- License: mit
- Created: 2019-11-29T08:16:31.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-02T07:14:49.000Z (over 3 years ago)
- Last Synced: 2025-06-12T07:10:18.986Z (about 1 year ago)
- Topics: clean-css, laravel-mix, laravel-mix-extension, laravel-mix-plugin, npm-package, webpack
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/laravel-mix-clean-css
- Size: 1.93 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Laravel Mix clean-css
[](https://npmjs.com/package/laravel-mix-clean-css)
[](https://www.npmjs.com/package/laravel-mix-clean-css)
[](LICENSE)
This extension adds support for [clean-css](https://github.com/jakubpawlowicz/clean-css) to [Laravel Mix](https://github.com/JeffreyWay/laravel-mix) by using the [clean-css-loader](https://github.com/retyui/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:
```javascript
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](https://github.com/jakubpawlowicz/clean-css/blob/master/README.md).