UNPKG

laravel-elixir-helper

Version:

laravel-elixir-helper is npm package built on top of laravel-elixir and gulp, its an easy cleaning solution to CSS / JS mess. Giving you a nice clean structure for organizing all your sites assets whether it is images, javascript files, or stylesheets and

63 lines (57 loc) 2.5 kB
/** * Documentation * * tasks: [ * { * package: "package-name", // template name use to describe the package object * files: [ * { * copy: { * from: "package-name/dist/images/**", // copy all (/**) images from the package folder witch is vendor/bower_dl/package-name/dist/images/** * to: "public/img/package-name" // copy all images to public/img/package-name * }, * copy: { // copy and do search and replace and rename at the same time * from: "package-name/src/css/styles.css", // copy css from vendor/bower_dl/package-name/src/css/styles.css * * // you can always visit https://www.npmjs.com/package/gulp-replace for more information about regex * // regex e.g: { find: /foo(.{3})/g, with: '$1foo' } * replace: { * find: 'images/', // find in the document * with: '/img/package-name/' // and replace it with * }, * * // you can always visit https://github.com/hparra/gulp-rename for more information about renaming * // regex e.g: rename:{ dirname: "main/text/ciao", basename: "aloha", prefix: "bonjour-", suffix: "-hola", extname: ".md" } * // output: some-where/bonjour-aloha-hola.md * rename: { * extname: ".scss" // change file extinstion to scss * }, * to: "vendor/bower_dl/package-name/src/sass/" // save file into this path * } * } * ] * }, * { * package: "Bootstrap", // copying bootstap fonts e.g * files: [ * { * copy: { * from: "bootstrap-sass/assets/fonts/bootstrap/**", // copy all files from vendor/bower_dl/bootstrap-sass/assets/fonts/bootstrap/** * to: "public/fonts/bootstrap" // to this folder * } * } * ] * } * ] */ var gutil = require('gulp-util'), color = require('gulp-color'), config = gutil.env.ALIXIR_CONFIG; var tasks = {}; try { var tasks = require(config.path.project + config.files.assets); }catch (error){ // do nothing console.log(color(error, "RED")); } module.exports = tasks;