Elixir合并后删除中间文件 [英] Delete intermediary files after elixir merge

查看:87
本文介绍了Elixir合并后删除中间文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Laravel5.在gulp任务期间,从资源文件夹复制的已处理SASS文件和其他CSS文件存储在public/css中. 然后,public/css中的所有文件都合并在一起,成为"all.css"一个文件.因此,创建的文件需要删除.

I am using Laravel 5. During gulp task, the processed SASS files and other CSS files copied from resource folder are stored in public/css. Then all the files in the public/css are merged together to a single file as "all.css". So the files that were created needs to be deleted.

我该怎么做?

推荐答案

对于较新版本的laravel,它对我有用:

For newer versions of laravel this worked for me:

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

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

elixir(function(mix) {
    mix.remove([ 'public/css', 'public/js' ]);
});

干杯!

这篇关于Elixir合并后删除中间文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆