laravel-elixir-postcss
v0.5.0
Published
Laravel Elixir PostCSS Extension
Downloads
16
Maintainers
Readme
laravel-elixir-postcss
This Laravel Elixir extension allows you easy to compile PostCSS.
If this package helpful and save your time. Do not forget star it :)
Installation
$ npm install laravel-elixir-postcss --save-dev
Usage
elixir(function(mix) {
//app.css, *.css, **/*.css
elixir.postcss('app.css');
});
Using PostCSS Plugins
elixir(function(mix) {
mix.postcss('app.css', {
plugins:[
require('postcss-nested')
]
});
});
Using Other Parser
You can set the options using other parsers like scss
, sugarss
etc.
elixir(function(mix) {
mix.postcss('app.css', {
options: {
parser: require('postcss-scss')
},
});
});
Use parser
and plugins
.
elixir(function(mix) {
mix.postcss('app.css', {
options: {
parser: require('sugarss')
},
plugins: [
require('postcss-nested')
],
});
});
Options
This extension accept two parameters:
- An string of files.
- An object of options.
Common options:
options
: See postcss common options.output
: destination's pathplugins
: postcss's plugins.srcPath
: source's directory.sourcemaps
: enable source map.watchs
: additional watch directories.
Default Value
{
options: {},
output : 'public/css',
plugins : [],
srcPath : 'resources/assets/postcss/',
sourcemaps: true, //default value follow `elixir.config.sourcemaps`
watchs: [],
}
Contributing
Welcome PR and play it :smile: