压缩文件 -> 加时间戳 clean -> copy -> concat -> min -> md5 1. grunt-contrib-clean:Clear files and folders. 2. grunt-contrib-copy save-dev,会在package.json中加上devDependencies依赖) npm install grunt-contrib-clean --save-dev npm install grunt-contrib-copy grunt": "^0.4.5", "grunt-contrib-clean": "^0.6.0", "grunt-contrib-concat": "^0.5.1", "grunt-contrib-copy } } }); // 载入要使用的插件 grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-contrib-copy
并列举了部分插件示例: 插件名称 说明 Github地址 grunt-contrib-clean 清空文件和文件夹 https://github.com/gruntjs/grunt-contrib-clean grunt-contrib-copy 复制文件和文件夹 https://github.com/gruntjs/grunt-contrib-copy grunt-contrib-concat 连接、合并文件 https://github.com
并列举了部分插件示例: 插件名称 说明 Github地址 grunt-contrib-clean 清空文件和文件夹 https://github.com/gruntjs/grunt-contrib-clean grunt-contrib-copy 复制文件和文件夹 https://github.com/gruntjs/grunt-contrib-copy grunt-contrib-concat 连接、合并文件 https://github.com
) { grunt.log.writeln(this.target+':'+this.data); }); }; 以下是插件的一部分功能 复制文件 npm install grunt-contrib-copy --save-dev grunt.loadNpmTasks('grunt-contrib-copy'); grunt.initConfig({ copy:{
grunt": "^0.4.5", "grunt-contrib-concat": "^1.0.1", "grunt-contrib-connect": "^1.0.2", "grunt-contrib-copy grunt.loadNpmTasks('grunt-contrib-less'); grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-copy
grunt-contrib-concat npm install grunt-contrib-watch npm install grunt-contrib-connect npm install grunt-contrib-copy
grunt.loadNpmTasks('grunt-contrib-copy'); 可以通过“load-grunt-tasks”进行一次性载入所有插件,无需依依引入。 dest: '<%= config.dest %>/dest/' } } }); // 加载插件 grunt.loadNpmTasks('grunt-contrib-copy copy为Task,加载“grunt-contrib-copy”插件 copy中的js为Target,可以通过grunt copy:js执行 通配符说明: 通配符 说明 * 匹配任意数量的字符,但不匹配
. >> Local Npm module "grunt-contrib-copy" not found. Is it installed? registry.npm.taobao.org npm install grunt-contrib-connect --registry=https://registry.npm.taobao.org npm install grunt-contrib-copy
grunt-contrib-copy可以实现这个功能。 build文件夹下的内容放到blog_source分支。grunt-gh-pages可以实现这个功能。
1.7.0", "babel-preset-es2015": "^6.24.1", "grunt": "^1.1.0", "grunt-babel": "^7.0.0", "grunt-contrib-copy
ok npm install grunt-contrib-copy npm install grunt-contrib-concat npm install grunt-contrib-uglify
save-dev npm install grunt-contrib-clean grunt-contrib-concat grunt-contrib-watch grunt-contrib-connect grunt-contrib-copy
比如按照对 src 文件的处理方式的不同,grunt-contrib-clean 和 grunt-contrib-copy 就属于两种典型代表。 one", "path/to/dir/two"] } release: ["path/to/another/dir/one", "path/to/another/dir/two"] } grunt-contrib-copy
比如按照对 src 文件的处理方式的不同,grunt-contrib-clean 和 grunt-contrib-copy 就属于两种典型代表。 one", "path/to/dir/two"] } release: ["path/to/another/dir/one", "path/to/another/dir/two"] } grunt-contrib-copy
要用的工具是 Grunt,使用到的插件如下: "devDependencies": { "grunt": "^0.4.5", "grunt-contrib-clean": "^1.0.0", "grunt-contrib-copy 使用到的插件如下: "devDependencies": { "grunt": "^0.4.5", "grunt-contrib-clean": "^0.7.0", "grunt-contrib-copy
grunt-contrib-concat npm install grunt-contrib-watch npm install grunt-contrib-connect npm install grunt-contrib-copy
package.json中存在grunt-contrib-copy的依赖项 确认该插件安装完成后,就可以在grunt的配置文件Gruntfile.js编写该插件的配置信息了。 ?
elasticsearch-head-master]$ npm install grunt-contrib-clean grunt-contrib-concat grunt-contrib-watch grunt-contrib-connect grunt-contrib-copy elasticsearch-head-master]$ npm install grunt-contrib-clean grunt-contrib-concat grunt-contrib-watch grunt-contrib-connect grunt-contrib-copy
首先我们要将npm的package.json添加到工程中,然后安装grunt及其插件(grunt-contrib-less,less-plugin-clean-css,grunt-contrib-clean,grunt-contrib-copy } } }) grunt.loadNpmTasks('grunt-contrib-less') grunt.loadNpmTasks('grunt-contrib-copy
首先我们要将npm的package.json添加到工程中,然后安装grunt及其插件(grunt-contrib-less,less-plugin-clean-css,grunt-contrib-clean,grunt-contrib-copy } } }) grunt.loadNpmTasks('grunt-contrib-less') grunt.loadNpmTasks('grunt-contrib-copy