grunt搭建

安装

  1. 安装node.js
  2. 更新 npm工具
npm update -g npm
  1. 安装 Grunt CLI
npm install -g grunt-cli
  1. 创建package.json文件
{
"name": "myapp",
"version": "0.1.1",
"devDependencies": {
}
}
  1. 安装Grunt
npm install grunt --save-dev
  1. 根目录下创建Grunt的配置文件 - Gruntfile.js
module.exports = function(grunt) {
grunt.initConfig({//initConfig初始pkg属性
pkg: grunt.file.readJSON('package.json')
});
};
  1. 卸载 grunt
npm uninstall grunt-cli -g
原文地址:https://www.cnblogs.com/jjyyddss/p/280c325af6552d1fb6485c436e0adf6b.html