我可以通过跑步来解决这个问题
del
在
then()
mix.styles()
:
const mix = require('laravel-mix');
const del = require('del');
// compile sass into temp css file
mix.sass('resources/stylesheets/style.scss', 'public/css/temp.css');
// compile css
mix.styles([
// other css stylesheets here...
'public/css/temp.css' // include temp css file
], 'public/css/admin.min.css').then(() => {
del('public/css/temp.css'); // deletes the temp file
});
同样的东西也适用于
mix.scripts()
mix.scripts([
'public/js/app.js',
'public/js/global.js',
], 'public/js/app.combined.js').then(() => {
del('public/js/app.js');
del('public/js/global.js');
});