Laravel-mix: How to extend mix?

Created on 26 Jan 2017  路  2Comments  路  Source: JeffreyWay/laravel-mix

Any clue on how to extend Mix like it's possible with elixir?

const elixir = require('laravel-elixir');
const gulp = require('gulp');
const svgmin = require('gulp-svgmin');

elixir.extend('svgmin', (filename, options) => {
    new elixir.Task('svgmin', () => {
        gulp.src('resources/assets/svg/' + filename)
            .pipe(svgmin(options))
            .pipe(gulp.dest('public/svg/'))
    })
})

Most helpful comment

I found it relatively easy to extend over the CustomTasksPlugin.

Checkout laravel-mix-pug to get the idea on how to do it.

Great work @JeffreyWay !

All 2 comments

Mix doesn't have any plugin ecosystem. If you need to extend it, copy Mix's webpack.config.js file to your project root, and then modify it directly like any other project that uses Webpack.

I found it relatively easy to extend over the CustomTasksPlugin.

Checkout laravel-mix-pug to get the idea on how to do it.

Great work @JeffreyWay !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mstralka picture mstralka  路  3Comments

jpmurray picture jpmurray  路  3Comments

sdebacker picture sdebacker  路  3Comments

wendt88 picture wendt88  路  3Comments

pixieaka picture pixieaka  路  3Comments