在每个成功的laravel mix构建上执行artisan命令

时间:2018-02-02 16:49:15

标签: laravel laravel-mix

如何在每次成功的laravel混音构建中执行工匠命令?

1 个答案:

答案 0 :(得分:1)

let mix = require('laravel-mix');
let child_process = require('child_process');

mix.js('Resources/js/core-app.js', 'Assets/js')
     .then(() => {
         child_process.exec('php artisan module:publish', {cwd: '../../'}, function(error, stdout, stderr){
             if (error) throw error;

             console.log(stdout, stderr);
    });
});