Skip to content

Instantly share code, notes, and snippets.

@zach2825
Created August 1, 2016 01:32
Show Gist options
  • Save zach2825/3cb08a51eaf4b8d1bbe219927eedec9e to your computer and use it in GitHub Desktop.
Save zach2825/3cb08a51eaf4b8d1bbe219927eedec9e to your computer and use it in GitHub Desktop.
var elixir = require('laravel-elixir');
/*
|--------------------------------------------------------------------------
| Elixir Asset Management
|--------------------------------------------------------------------------
|
| Elixir provides a clean, fluent API for defining some basic Gulp tasks
| for your Laravel application. By default, we are compiling the Sass
| file for our application, as well as publishing vendor resources.
|
*/
var gulp = require('gulp')
, minifyCss = require("gulp-minify-css")
, uglify = require("gulp-uglify")
, rename = require('gulp-rename');
require('laravel-elixir-livereload');
elixir(function(mix) {
mix.sass('app.scss');
mix.livereload();
mix.scripts([
'bower_components/jquery/dist/jquery.js',
'bower_components/bootstrap/dist/js/bootstrap.js',
'bower_components/angular/angular.js',
'bower_components/angular-animate/angular-animate.js',
'bower_components/angular-messages/angular-messages.js',
'bower_components/angular-aria/angular-aria.min.js',
'bower_components/angular-material/angular-material.js',
'bower_components/tinymce/tinymce.js',
'bower_components/tinymce/themes/modern/theme.js',
'bower_components/angular-ui-tinymce/src/tinymce.js',
'bower_components/toastr/toastr.js'
], 'public/js/vendor.js','./');
mix.styles([
'bower_components/bootstrap/dist/css/bootstrap.css',
'bower_components/angular-material/angular-material.css',
'bower_components/angular-material/layouts/angular-material.layouts.css',
'bower_components/toastr/toastr.css'
], 'public/css/vendor.css','./');
mix.copy('bower_components/tinymce/skins', 'public/build/js/skins');
mix.copy('bower_components/tinymce/themes', 'public/build/js/themes');
mix.copy('bower_components/tinymce/plugins', 'public/build/js/plugins');
gulp.src('public/css/vendor.css') // path to your file
.pipe(minifyCss())
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest('public/css/'));
gulp.src('public/js/vendor.js') // path to your files
.pipe(uglify())
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest('public/js/'));
// task
gulp.task('minify-css', function () {
gulp.src('public/css/vendor.css') // path to your file
.pipe(minifyCss())
.pipe(gulp.dest('public/css/'));
});
gulp.task('minify-js', function () {
gulp.src('public/js/vendor.js') // path to your files
.pipe(uglify())
.pipe(gulp.dest('public/js/'));
});
mix.version([
'public/css/app.css',
'public/css/vendor.min.css',
'public/js/vendor.min.js'
]);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment