Secret elixir is a simplified version of Laravel elixir created special for frontend tasks.
npm install secret-elixir --save
Create gulpfile.js
in the base directory.
Example:
var elixir = require('secret-elixir');
elixir(function (mix) {
//working with single file
mix.less('./path/to/less/file', './path/to/build/destination');
//or array of files
mix.scripts([
'./path/to/first/js/file',
'./path/to/second/js/file',
], './path/to/build/destination);
//or glob
mix.copy('./path/to/files/*', './path/to/destination');
});
Run with gulp
or gulp watch
for real time updating.
Also, there is a --production
flag used for minification.
mix.styles
- concatenates css
files + autoprefixer
mix.scripts
- concatenates js
files
mix.babel
- transpiles ES6
to ES5
mix.less
- compiles less to css + autoprefixer + base64
mix.sass
- compiles sass to css + autoprefixer + base64
mix.html
- passes html
files to gulp-rigger
mix.copy
- copies files to destination
mix.concat
- concatenates files (useful when there is no need of minification in production mode)