grunt-contrib-clean插件-tasks目录下clean.js文件中配置了一个clean任务:
grunt.registerMultiTask('clean', 'Clean files and folders.', function() {
// Merge task-specific and/or target-specific options with these defaults.
var options = this.options({
force: grunt.option('force') === true,
'no-write': grunt.option('no-write') === true,
});
grunt.verbose.writeflags(options, 'Options');
// Clean specified files / dirs.
this.filesSrc.forEach(function(filepath) {
clean(filepath, options);
});
});
所以在Gruntfile.js中配置任务的时候很简单:
grunt.initConfig({
clean : {
dist : ['/a','/b','/c'],
server : 'a'
}
}),
这样执行 grunt clean:dist 命令时就可以成功删除 a.b.c 目录下的文件。
https://www.npmjs.com/package/grunt-contrib-clean
分享到:
相关推荐
grunt-contrib-clean v2.0.0 清理文件和文件夹 入门 如果您以前从未使用过 ,请务必查看《指南》,因为它说明了如何创建以及安装和使用Grunt插件。 熟悉该过程后,可以使用以下命令安装此插件: npm install grunt...
grunt-cli的0.1.13版本压缩包,里面带有node_modules等目录。供有需要的人使用。
grunt-electron-installer, 为电子应用构建 Windows 安装程序的插件插件 电子安装程序Grunt插件 Grunt插件,为电子应用程序构建 Windows 安装程序,使用 ...安装npm install --save-dev grunt-electron-installer配置
grunt-contrib-copy, 复制文件和文件夹 grunt-contrib-copy-v1.0.0 复制文件和文件夹正在启动If之前,请务必先查看一下如何创建 Gruntfile插件,以及安装和使用Grunt插件。 熟悉该过程后,你可以使用以下命令安装...
grunt运行的命令行 放在C:\Users\Administrator\AppData\Roaming\npm\node_modules\grunt-cli下的
使用grunt-babel 转换es6 到es5依赖库
grunt-bower-task, 面向 Bower的Grunt插件 grunt-bower-task 安装 Bower 软件包明智地安装。正在启动注意:如果你以前没有使用过 grunt,那么一定要检查一下 guide指南 guide 。 请注意,这里插件仅使用 grunt 的
grunt-ssh, SSH,Grunt的SFTP任务 新主人 启动 12 -23-2015,我正站在两个巨人( @chuckmo和 @andrewrjones) 作为这个项目维护者的肩膀上) 。 欢迎捐赠,如往常。 ( 这里消息也将在下一次发布时删除) 。静音 ssh
前端开源库-grunt-cmd-transport-wndgrunt cmd传输wnd,将javascript传输到cmd。
前端开源库-grunt-inline-angular-templates咕哝内联角度模板,内联角度模板到HTML文件中
前端开源库-grunt-es6-transpilerGrunt-ES6-蒸腾器,蒸腾ES6至ES5
前端开源库-grunt-obfuscator-node咕哝模糊节点,模糊节点通过咕哝项目
grunt-cache-bust, 使用内容散列缓存 static 资产 grunt-cache-bust 使用内容散列从高速缓存中触发 static 资产正在开始运行。简介是如何工作的。选项用法示例更改日志记录请阅读这里插件最近升级到 v1.0.0 ! 插件...
前端开源库-grunt-contrib-testemgrunt contrib testem,testem程序化运行程序,通过切碎机预处理增强
前端开源库-grunt-connect-proxygrunt connect proxy,提供一个HTTP代理作为grunt connect的中间件。
前端开源库-grunt-transport-pas咕哝传输pas,将javascript传输到cmd。
grunt-cli-main.zip
grunt-responsive-images, 针对响应式网站的不同大小,生成图像 grunt-responsive-images 生成不同大小的图像正在启动这个插件需要 Grunt ~0.4.5 。If之前,请务必先查看一下如何创建 Gruntfile插件,以及安装和使用...
px、rem转换工具 grunt-px2rem-master
grunt-contrib-茉莉花v2.2.0 通过无头Chrome轻松运行茉莉花规格 入门 如果您以前从未使用过 ,请务必查看《指南》,因为它说明了如何创建以及安装和使用Grunt插件。 熟悉该过程后,可以使用以下命令安装此插件: ...