How to use the laravel-elixir.extend function in laravel-elixir

To help you get started, we’ve selected a few laravel-elixir examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jadjoubran / laravel5-angular-material-starter / tasks / angular.task.js View on Github external
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var eslint = require('gulp-eslint');
var uglify = require('gulp-uglify');
var ngAnnotate = require('gulp-ng-annotate');
var notify = require('gulp-notify');
var gulpif = require('gulp-if');

var webpack = require('webpack-stream');
var webpackConfig = require('../webpack.config.js')

var Elixir = require('laravel-elixir');

var Task = Elixir.Task;

Elixir.extend('angular', function(src, output, outputFilename) {

	var baseDir = src || Elixir.config.assetsPath + '/angular/';

	new Task('angular in ' + baseDir, function() {
		// Main file has to be included first.
		return gulp.src([baseDir + "index.main.js", baseDir + "**/*.*.js"])
			.pipe(eslint())
			.pipe(eslint.format())
			.pipe(gulpif(!config.production, sourcemaps.init()))
			.pipe(webpack(webpackConfig))
			.pipe(ngAnnotate())
			.pipe(gulpif(config.production, uglify()))
			.pipe(gulpif(!config.production, sourcemaps.write()))
			.pipe(gulp.dest(output || config.js.outputFolder))
			.pipe(notify({
				title: 'Laravel Elixir',
github HRcc / laravel-elixir-angular / index.js View on Github external
var gulp = require('gulp');
var concat = require('gulp-concat');
var sourcemaps = require('gulp-sourcemaps');
var jshint = require('gulp-jshint');
var stylish = require('jshint-stylish');
var uglify = require('gulp-uglify');
var ngAnnotate = require('gulp-ng-annotate');
var notify = require('gulp-notify');
var gulpif = require('gulp-if');

var Elixir = require('laravel-elixir');

var Task = Elixir.Task;

Elixir.extend('angular', function(src, output, outputFilename) {

    var baseDir = src || Elixir.config.assetsPath + '/angular/';

    new Task('angular in ' + baseDir, function() {
        var onError = function(err) {
            notify.onError({
                title:    "Laravel Elixir",
                subtitle: "Angular Compilation Failed!",
                message:  "Error: <%= error.message %>",
                icon: __dirname + '/../laravel-elixir/icons/fail.png'
            })(err);

            this.emit('end');
        };

        // Module inits have to be included first.
github laravel / elixir / tasks / speak.js View on Github external
var gulp = require('gulp');
var shell = require('gulp-shell');
var Elixir = require('laravel-elixir');

Elixir.extend('speak', function(message) {
    // new Elixir.Task('speak')
    //     .describe(function() {
    //         return gulp.src('').pipe(shell('say ' + message));
    //     });

    new Elixir.Task('speak', function() {
        return gulp.src('').pipe(shell('say ' + message));
    });
});

// mix.speak('Hello World');
github waynestate / base-site / gulpfile.js View on Github external
let output = 'public/_static';
        let src = 'storage/app/public';

        // Summary Reporting
        this.src = src;
        this.output = output;
        this.recordStep('Create symbolic');

        return gulp.src(src)
            .pipe(sym(output, { force: true}));
    });
});

// Create the hook symlink
elixir.extend('hooks', function() {
    new elixir.Task('hooks', function() {
        "use strict";

        let output = '.git/hooks';
        let src = 'hooks/*';

        // Summary Reporting
        this.src = src;
        this.output = output;
        this.recordStep('Copying hooks to .git');

        // Copy Hooks
        return gulp.src(src)
            .pipe(gulp.dest(output))
    });
});
github waynestate / base-site / gulpfile.js View on Github external
var output_blade = elixir.config.viewPath + '/partials';

        // Summary Reporting
        this.recordStep('Copying footer');
        this.src = src_html;
        this.output = output_blade;

        // Copy and rename HTML
        return gulp.src(src_html)
            .pipe(rename({suffix: '.blade', extname: '.php'}))
            .pipe(gulp.dest(output_blade));
    });
});

// Copy over the HTTP Errors resources
elixir.extend('errors', function() {
    new elixir.Task('errors', function() {
        // Sources
        var src_css = [
            'vendor/waynestate/error-404/dist/404.css',
            'vendor/waynestate/error-404/dist/404.css.map',
            'vendor/waynestate/error-403/dist/403.css',
            'vendor/waynestate/error-403/dist/403.css.map',
            'vendor/waynestate/error-500/dist/500.css',
            'vendor/waynestate/error-500/dist/500.css.map',
        ];
        var src_images = [
            'vendor/waynestate/error-404/dist/404.png',
            'vendor/waynestate/error-403/dist/403.png',
            'vendor/waynestate/error-500/dist/500.png'
        ];
        var src_blade = [
github jadjoubran / laravel5-angular-material-starter / tasks / bower.task.js View on Github external
*/
var gulp = require('gulp');
var mainBowerFiles = require('main-bower-files');
var filter = require('gulp-filter');
var notify = require('gulp-notify');
var cssnano = require('gulp-cssnano');
var uglify = require('gulp-uglify');
var concat_sm = require('gulp-concat-sourcemap');
var concat = require('gulp-concat');
var gulpIf = require('gulp-if');

var Elixir = require('laravel-elixir');

var Task = Elixir.Task;

Elixir.extend('bower', function(jsOutputFile, jsOutputFolder, cssOutputFile, cssOutputFolder) {

    var cssFile = cssOutputFile || '../public/css/vendor.css';
    var jsFile = jsOutputFile || '../public/js/vendor.js';

    if (!Elixir.config.production){
        concat = concat_sm;
    }

    var onError = function (err) {
        notify.onError({
            title: "Laravel Elixir",
            subtitle: "Bower Files Compilation Failed!",
            message: "Error: <%= error.message %>",
            icon: __dirname + '/../node_modules/laravel-elixir/icons/fail.png'
        })(err);
        this.emit('end');
github devfake / laravel-elixir-remove / index.js View on Github external
var gulp = require('gulp');
var elixir = require('laravel-elixir');
var del = del = require('del');

var Task = elixir.Task;
var config = elixir.config;

elixir.extend('remove', function(path) {
    new Task('remove', function() {
        return del(path);
    })
    .watch(elixir.config.assetsPath + '/**');
});
github nothing628 / ai-cms / gulpfile.js View on Github external
/*
 |--------------------------------------------------------------------------
 | 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 del = require('del');

elixir.extend('sourcemaps', false);

elixir.extend('remove', function(path) {
	new elixir.Task('remove', function() {
		del(path);
	});
});

elixir(mix => {
	mix.less('./node_modules/slick-carousel/slick/slick.less');
	mix.scripts('./node_modules/slick-carousel/slick/slick.min.js');
	mix.styles('./node_modules/select2/dist/css/select2.min.css');
	mix.scripts('./node_modules/select2/dist/js/select2.full.min.js');

	mix.styles('font.css');
	mix.styles(['dropzone.css', 'oneui.css', 'modern.css', 'app.css', 'sweetalert2.css'], 'public/css/app.css');
	//mix.styles(['app.css'], 'public/css/app.css');
	mix.scripts('oneui.js');
	mix.webpack('app.js','public/js','resources/assets/js',{
github devimust / easy-bookmark-manager / elixir-extensions.js View on Github external
var gulp = require('gulp');
var shell = require('gulp-shell');
var Elixir = require('laravel-elixir');
var del = require('del');
var jshint = require('gulp-jshint');

var Task = Elixir.Task;

Elixir.extend('remove', function(path) {

    new Task('remove', function() {
        del(path);
        return gulp.src('');
    });

});


Elixir.extend('jshint', function(path) {

    new Task('jshint', function() {
        return gulp.src(path)
            .pipe(jshint())
            .pipe(jshint.reporter('default'));
    });
github laravel / elixir / ingredients / copy.js View on Github external
var gulp   = require('gulp');
var copy   = require('./commands/CopyFiles');
var elixir = require('laravel-elixir');
var config = elixir.config;

/*
 |----------------------------------------------------------------
 | Copying
 |----------------------------------------------------------------
 |
 | This task offers a simple way to copy files from one place to
 | another. That's it. Not any more complicated than that!
 |
 */

elixir.extend('copy', function(source, destination) {
    return copy(source, destination);
});

laravel-elixir

Laravel Elixir Core

MIT
Latest version published 7 years ago

Package Health Score

45 / 100
Full package analysis

Popular laravel-elixir functions