{"id":956,"date":"2014-06-04T16:55:16","date_gmt":"2014-06-04T08:55:16","guid":{"rendered":"http:\/\/www.storagelab.org.cn\/zhangdi\/?p=956"},"modified":"2014-06-04T16:55:16","modified_gmt":"2014-06-04T08:55:16","slug":"grunt%e7%9a%84%e5%ae%89%e8%a3%85%e4%b8%8e%e4%bd%bf%e7%94%a8","status":"publish","type":"post","link":"https:\/\/www.divis.cn\/index.php\/2014\/06\/04\/grunt%e7%9a%84%e5%ae%89%e8%a3%85%e4%b8%8e%e4%bd%bf%e7%94%a8\/","title":{"rendered":"grunt\u7684\u5b89\u88c5\u4e0e\u4f7f\u7528"},"content":{"rendered":"<p>&nbsp;<\/p>\n<figure style=\"width: 422px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/www.it165.net\/uploadfile\/files\/2013\/1216\/2013121620470838.png\" width=\"422\" height=\"497\" \/><figcaption class=\"wp-caption-text\">\u91ce\u732a\u4fa0\u5495\u565c<\/figcaption><\/figure>\n<p>Grunt\u662f\u57fa\u4e8eNode.js\u7684javascript\u9879\u76ee\u6784\u5efa\u5de5\u5177\u3002\u5b83\u7684\u5de5\u4f5c\u5c31\u662f\u8fd0\u884c\u4f60\u6240\u8bbe\u5b9a\u7684\u6279\u5904\u7406\u4efb\u52a1\u3002\u5176\u5b9e\u53bb\u5e74\u8fd9\u4e2a\u65f6\u5019\u6211\u5df2\u7ecf\u5f00\u59cb\u7528\u4e0agrunt\uff0c\u8fd9\u7bc7\u6587\u7ae0\u662f\u7ed9\u5e08\u5f1f\u5e08\u59b9\u4eec\u5b66\u4e60\u4e4b\u7528\u3002\u73b0\u9636\u6bb5\u5229\u7528github\u51e0\u4e4e\u5fc5\u987b\u5b66\u4f1a\u4f7f\u7528grunt\uff0c\u56e0\u4e3a\u5927\u591a\u6570javascript\u9879\u76ee\u90fd\u7528\u8be5\u5de5\u5177\u8fdb\u884c\u9879\u76ee\u7ba1\u7406\uff0c\u4e0d\u7528grunt\u8fde\u767b\u5802\u5165\u5ba4\u90fd\u505a\u4e0d\u5230\u3002<\/p>\n<h2>\u4e00.\u5b89\u88c5\u53ca\u4f7f\u7528\u6d41\u7a0b<\/h2>\n<p>1\uff09\u9996\u5148\u786e\u5b9a\u65e0\u8bba\u4f60\u662f\u4ec0\u4e48\u7cfb\u7edf\uff08windows\u3001linux\u3001macOS\uff09\uff0c\u7cfb\u7edf\u91cc\u9762\u90fd\u5df2\u7ecf\u88c5\u597d\u4e86nodejs\u3002\u53ef\u901a\u8fc7\u5728\u547d\u4ee4\u884c\u8f93\u5165npm -v\u6216\u8005node -v\u67e5\u770b\u7248\u672c\uff0c\u6765\u786e\u5b9anodejs\u662f\u5426\u5b89\u88c5\uff0c\u6ca1\u6709\u5c31\u53bbnodejs.org\u4e0a\u9762\u53bb\u4e0b\u8f7d\u5b89\u88c5\u3002<\/p>\n<p>2\uff09\u5728\u5168\u5c40\u4e2d\u5b89\u88c5grunt\u5ba2\u6237\u7aef\uff1a\u5728\u547d\u4ee4\u884c\u8f93\u5165\u00a0client\u00a0npm install -g grunt-cli\u6309\u56de\u8f66\u3002<\/p>\n<blockquote><p>\u8bf4\u660e\uff1agrunt\u6709\u4e8c\u4e2a\u90e8\u5206\uff1a\u670d\u52a1\u5668\u7aef\uff08grunt\uff09\u548c\u5ba2\u6237\u7aef\uff08grunt-cli\uff09\u3002grunt-cil\u7684\u4efb\u52a1\u5f88\u7b80\u5355\uff1a\u5141\u8bb8\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165grunt, \u8c03\u7528\u4e0eGruntfile.js\u5728\u540c\u4e00\u76ee\u5f55\u4e2d\u7684grunt\u670d\u52a1\u5668\u7aef\u7a0b\u5e8f\u3002\u6240\u4ee5\u5b89\u88c5grunt-cli\u5e76\u4e0d\u7b49\u4e8e\u5b89\u88c5\u4e86grunt\uff01\u6bcf\u4e2a\u8981\u4f7f\u7528grunt\u7684\u5de5\u7a0b\u76ee\u5f55\u4e0b\u8fd8\u8981\u5b89\u88c5grunt\u670d\u52a1\u7aef\u7248\u672c\uff0c\u5177\u4f53\u8bf7\u770b\u6b65\u9aa44\u7684\u8bf4\u660e\u3002<\/p><\/blockquote>\n<p>3\uff09\u627e\u4e00\u4e2a\u5927\u725b\u4eec\u7684\u5de5\u7a0b\u800d\u800d\uff0c\u4f8b\u5982github\u4e0a\u7684<a href=\"https:\/\/github.com\/angular\/angular.js\">angularjs<\/a>\uff0c\u6216\u8005<a href=\"https:\/\/github.com\/twbs\/bootstrap\">bootstrap<\/a>\uff0cgit clone\u5230\u81ea\u5df1\u7684\u6d4b\u8bd5\u6587\u4ef6\u5939\u4e0b\u3002<\/p>\n<p>4\uff09\u5728\u76ee\u6807\u5de5\u7a0b\u9879\u76ee\u4e2d\u5b89\u88c5grunt\u670d\u52a1\u5668\u7aef\uff1a\u6253\u5f00\u547d\u4ee4\u884c\uff0c\u5207\u5230\u8be5\u5de5\u7a0b\u7684\u6839\u76ee\u5f55\uff0c\u8f93\u5165npm install\u6309\u56de\u8f66\u3002<\/p>\n<blockquote><p>\u8bf4\u660e\uff1agrunt\u662f\u57fa\u4e8enodejs\u7684\u9879\u76ee\u6784\u5efa\u5de5\u5177\uff0c\u56e0\u6b64\u4f7f\u7528npm\u5305\u7ba1\u7406\u5de5\u5177\u5b89\u88c5\u5373\u53ef\u3002\u4e00\u822c\u800c\u8a00\uff0cgrunt \u548c grunt \u63d2\u4ef6\u90fd\u4f1a\u5728\u8fd9\u4e9b\u9879\u76ee\u6839\u76ee\u5f55\u4e0b\u7684<a href=\"https:\/\/npmjs.org\/doc\/json.html\">package.json<\/a>\u6587\u4ef6\u4e2d\u5b9a\u4e49\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u901a\u8fc7\u4e00\u4e2a\u547d\u4ee4\u5c06\u5f53\u524d\u9879\u76ee\u4f9d\u8d56\u7684\u6a21\u5757\u5b89\u88c5\u5b8c\u6bd5\u3002\uff08\u5982\u679cgrunt\u6ca1\u6709\u5728\u9879\u76ee\u7684package.json\u6587\u4ef6\u4e2d\u5b9a\u4e49\uff0c\u5219\u65e0\u6cd5\u6267\u884c\u4e4b\u540e\u7684grunt\u547d\u4ee4\uff0c\u9700\u8981\u4f7f\u7528npm install grunt\u547d\u4ee4\u5b89\u88c5grunt\u670d\u52a1\u5668\u7aef\uff09<\/p>\n<p>\u4e8b\u5b9e\u4e0a\uff0c\u5bf9\u4e8e\u6bcf\u4e2a\u9879\u76ee\uff0c\u90fd\u8981\u6267\u884c\u76f8\u4f3c\u7684\u5de5\u4f5c\uff0c\u4ece\u800c\u5bf9\u6bcf\u4e2a\u9879\u76ee\u751f\u6210\u5176\u7279\u5b9a\u7684grunt\u7248\u672c\u3002\u8fd9\u662f\u5f88\u6b63\u5e38\u7684\uff0c\u56e0\u4e3a\u4e0d\u540c\u9879\u76ee\u53ef\u80fd\u9700\u8981\u4e0d\u540c\u7684grunt\u6a21\u5757\uff0c\u6216\u8005\u540c\u4e00\u4e2a\u6a21\u5757\u7684\u4e0d\u540c\u7248\u672c\uff0c\u6545\u800c\u4e00\u4e2a\u9879\u76ee\u4e00\u4e2agrunt\u670d\u52a1\u662f\u6700\u597d\u7684\u7ed3\u679c\u3002<\/p><\/blockquote>\n<p>5\uff09\u6267\u884cgrunt\u6279\u5904\u7406\u529f\u80fd\uff1a\u5728\u547d\u4ee4\u884c\u8f93\u5165grunt\u6309\u56de\u8f66\u3002\u4e4b\u540e\u4f1a\u6309gruntfile.js\u4e2d\u9884\u5b9a\u4e49\u7684\u6279\u5904\u7406\u547d\u4ee4\u751f\u6210\u5404\u79cd\u6587\u4ef6\u3002\u770b\u770b\u547d\u4ee4\u884c\u7684\u63d0\u793a\uff0c\u4ee5\u53ca\u76ee\u5f55\u4e2d\u591a\u4e86\u4ec0\u4e48\u6587\u4ef6\u3002OK\uff0c\u5230\u8fd9\u91cc\u4f60\u5df2\u7ecf\u5b66\u4f1a\u600e\u4e48\u7528grunt\u4e86\u3002<\/p>\n<h2>\u4e8c. package.json\u6587\u4ef6\u7684\u4e66\u5199<\/h2>\n<p>\u867d\u7136\u6211\u4eec\u5df2\u7ecf\u4f1a\u4f7f\u7528grunt\u6267\u884c\u547d\u4ee4\uff0c\u4f46\u662f\u8fd8\u4e0d\u4f1a\u5199\u8fd9\u4e9b\u547d\u4ee4\u3002\u5b66\u4f1a\u4f7f\u7528grunt\u8fdb\u884c\u6279\u5904\u7406\u7684\u5173\u952e\u662f\u5b66\u4f1a\u5199package.json\u548cgruntfile.js\u8fd9\u4e24\u4e2a\u6587\u4ef6\u3002package.json\u662f\u5b9a\u4e49\u4f9d\u8d56\u5305\u7684\u76ee\u5f55\u6587\u4ef6\uff0c\u800cgruntfile.js\u662f\u6279\u5904\u7406\u547d\u4ee4\u6587\u4ef6\u3002package.json\u6bd4\u8f83\u7b80\u5355\uff0c\u4e0agithub\u591a\u770b\u51e0\u4e2a\u5927\u725b\u5de5\u7a0b\u7684package.json\u5c31\u77e5\u9053\u600e\u4e48\u5199\u4e86\u3002\u8003\u8651\u5230\u521d\u5b66\u8005\u770b\u5230\u592a\u5927\u6bb5\u7684\u6587\u5b57\u53ef\u80fd\u770b\u4e0d\u61c2\uff0c\u6211\u8fd9\u91cc\u63d0\u4f9b\u4e00\u4e2a\u7b80\u77ed\u7684\u4f8b\u5b50\uff0c\u6765\u81ea\u4e8erobin\u9879\u76ee\uff1a<\/p>\n<pre class=\"lang:default decode:true\">{\n  \"name\": \"robin_zycj\",\n  \"version\": \"1.0.0\",\n  \"devDependencies\": {\n    \"grunt\": \"~0.4.1\",\n    \"grunt-contrib-clean\": \"0.4.0\",\n    \"grunt-contrib-compress\": \"0.4.1\",\n    \"grunt-contrib-concat\": \"~0.2.0\",\n    \"grunt-contrib-connect\": \"0.1.2\",\n    \"grunt-contrib-copy\": \"~0.5.0\",\n    \"grunt-contrib-csslint\": \"~0.1.1\",\n    \"grunt-contrib-cssmin\": \"~0.5.0\",\n    \"grunt-contrib-imagemin\": \"~0.1.2\",\n    \"grunt-contrib-less\": \"~0.11.1\",\n    \"grunt-contrib-uglify\": \"~0.2.0\",\n    \"grunt-css\": \"&gt;0.0.0\",\n    \"grunt-string-replace\": \"^0.2.7\"\n  }\n}<\/pre>\n<p>grunt\u53cagrunt\u7684\u63d2\u4ef6\u90fd\u5b9a\u4e49\u5728devDenpendencies\u5c5e\u6027\u4e2d\u3002\u5176\u4e2dgrunt-contrib\u7cfb\u5217\u63d2\u4ef6\u90fd\u662f\u7531grunt\u4e3b\u56e2\u961f\u7ef4\u62a4\u7684\u3002\u6bcf\u4e2a\u63d2\u4ef6\u4e4b\u540e\u5b9a\u4e49\u7684\u662f\u5176\u7248\u672c\u53f7\uff1a\u5982\u679c\u53ea\u662f\u201c0.1.2\u201d\u8fd9\u6837\u7684\u6570\u5b57\uff0c\u8868\u793a\u53ea\u5b89\u88c5\u8fd9\u4e2a\u7248\u672c\u3002\u5982\u679c\u52a0\u4e86\u6ce2\u6d6a\u53f7~\uff0c\u8868\u793a\u5141\u8bb8\u8be5\u63d2\u4ef6\u81ea\u52a8\u5347\u7ea7\u3002\u6839\u636e\u9700\u6c42\u9009\u62e9\u7248\u672c\u3002<\/p>\n<h2>\u4e09. gruntfile.js\u6587\u4ef6\u7684\u4e66\u5199<\/h2>\n<p>\u8fd9\u4e2agruntfile.js\u4e2d\u5b9a\u4e49\u7684\u662fgrunt\u7684\u6279\u5904\u7406\u547d\u4ee4\u3002\u6839\u636e\u9700\u6c42\u4e0d\u540c\u3001\u6240\u7528\u63d2\u4ef6\u4e0d\u540c\uff0c\u5dee\u522b\u5f88\u5927\uff0c\u6240\u4ee5\u4e0d\u80fd\u4e00\u6982\u800c\u8bba\u3002\u8fd9\u91cc\u6211\u53ea\u7ed9\u51fa\u4e00\u4e2a\u6211\u4ee5\u524d\u81ea\u52a8\u5904\u7406robin\u9879\u76ee\u524d\u7aef\u6587\u4ef6\u7684gruntfile.js\uff0c\u5e76\u6dfb\u52a0\u4e86\u4e9b\u6ce8\u91ca\u4f5c\u4e3a\u53c2\u8003\u3002<\/p>\n<pre class=\"lang:default decode:true\">module.exports = function (grunt) {\n    \/\/ \u7ed9grunt\u65b0\u5efa\u4e9b\u8bbe\u7f6e\n    grunt.initConfig({\n        \/\/\u9996\u5148\u628a\u76ee\u5f55\u62f7\u8d1d\u5230\u6307\u5b9a\u4f4d\u7f6e\n        copy: {\n            main: {\n                files: [\n                    \/\/ \u62f7\u8d1d\u6574\u4e2a\u76ee\u5f55\n                    {expand: true, cwd: '..\/views\/zoro\/', src: ['**'], dest: 'zoro\/'},\n                    \/\/ \u62f7\u8d1d\u5168\u90e8\u56fe\u7247\u6587\u4ef6\u5939\u5230\u6307\u5b9a\u76ee\u5f55\n                    {expand: true, flatten: false, cwd: '..\/views\/zoro\/module\/download\/css\/images\/', src: ['**'], dest: 'zoro\/module\/cssmin\/images\/'},\n                    {expand: true, flatten: false, cwd: '..\/views\/zoro\/module\/files\/css\/images\/', src: ['**'], dest: 'zoro\/module\/cssmin\/images\/'},\n                    {expand: true, flatten: false, cwd: '..\/views\/zoro\/module\/platform\/css\/images\/', src: ['**'], dest: 'zoro\/module\/cssmin\/images\/'},\n                    {expand: true, flatten: false, cwd: '..\/views\/zoro\/module\/robin\/cssv2\/images\/', src: ['**'], dest: 'zoro\/module\/cssmin\/images\/'},\n                ]\n            },\n        },\n\n        \/\/\u5bf9\u4e00\u4e9b\u6587\u4ef6\u8fdb\u884c\u5b57\u7b26\u4e32\u66ff\u6362\u5de5\u4f5c\uff0c\u8fd9\u6837\u505a\u662f\u4e3a\u4e86\u907f\u514d\u4fee\u6539\u4e3b\u7248\u672c\u4ee3\u7801\u7684\u60c5\u51b5\u4e0b\u751f\u6210\u65b0\u4ee3\u7801\n        'string-replace': {\n            robin: {\n                files: {\n                    'zoro\/module\/robin\/robin.js': '..\/views\/zoro\/module\/robin\/robin.js',\n                },\n                options: {\n                    replacements: [\n                        {\n                            pattern: \"require('less');\",\n                            replacement: ''\n                        },\n                        {\n                            pattern: 'require(\"module\/robin\/cssv2\/robin.less\");',\n                            replacement: 'require(\"module\/cssmin\/all.min.css\");'\n                        }\n                    ]\n                }\n            },\n            init: {\n                files: {\n                    'zoro\/init.js': '..\/views\/zoro\/init.js',\n                },\n                options: {\n                    replacements: [\n                        {\n                            pattern: \"'less' :            'core\/less',\",\n                            replacement: ''\n                        },\n                        {\n                            pattern: \",preload : ['core\/plugin-less']\",\n                            replacement: ''\n                        }\n                    ]\n                }\n            },\n            download: {\n                files: {\n                    'zoro\/download.php': '..\/views\/zoro\/download.php',\n                },\n                options: {\n                    replacements: [\n                        {\n                            pattern: '&lt;link rel=\"stylesheet\/less\" type=\"text\/css\" href=\"\/application\/views\/zoro\/module\/main\/css\/base.less\"&gt;',\n                            replacement: '&lt;link rel=\"stylesheet\" type=\"text\/css\" href=\"\/application\/views\/zoro\/module\/cssmin\/all.min.css\"&gt;'\n                        },\n                        {\n                            pattern: '&lt;link rel=\"stylesheet\/less\" type=\"text\/css\" href=\"\/application\/views\/zoro\/module\/robin\/cssv2\/reset.less\"&gt;',\n                            replacement: ''\n                        },\n                        {\n                            pattern: '&lt;link rel=\"stylesheet\/less\" type=\"text\/css\" href=\"\/application\/views\/zoro\/module\/robin\/cssv2\/robin.less\"&gt;',\n                            replacement: ''\n                        },\n                        {\n                            pattern: '&lt;link rel=\"stylesheet\/less\" type=\"text\/css\" href=\"\/application\/views\/zoro\/module\/download\/css\/styles.less\"&gt;',\n                            replacement: ''\n                        },\n                        {\n                            pattern: '&lt;script src=\"\/application\/views\/zoro\/core\/less.js\" type=\"text\/javascript\"&gt;&lt;\/script&gt;',\n                            replacement: ''\n                        }\n                    ]\n                }\n            },\n            others: {\n                files: {\n                    'zoro\/module\/circles\/circles.js': '..\/views\/zoro\/module\/circles\/circles.js',\n                    'zoro\/module\/files\/files.js': '..\/views\/zoro\/module\/files\/files.js',\n                    'zoro\/module\/files\/files_sync.js': '..\/views\/zoro\/module\/files\/files_sync.js',\n                    'zoro\/module\/files\/receives.js': '..\/views\/zoro\/module\/files\/receives.js',\n                    'zoro\/module\/files\/recycles.js': '..\/views\/zoro\/module\/files\/recycles.js',\n                    'zoro\/module\/platform\/platform.js': '..\/views\/zoro\/module\/platform\/platform.js',\n                },\n                options: {\n                    replacements: [\n                        {\n                            pattern: 'require(\"module\/circles\/css\/circle.less\");',\n                            replacement: ''\n                        },\n                        {\n                            pattern: 'require(\"module\/files\/css\/file.less\");',\n                            replacement: ''\n                        },\n                        {\n                            pattern: 'require(\"module\/files\/css\/recycle.less\");',\n                            replacement: ''\n                        },\n                        {\n                            pattern: 'require(\"module\/files\/css\/share.less\");',\n                            replacement: ''\n                        },\n                        {\n                            pattern: 'require(\"module\/files\/css\/receive.less\");',\n                            replacement: ''\n                        },\n                        {\n                            pattern: 'require(\"module\/files\/css\/linkman.less\");',\n                            replacement: ''\n                        },\n                        {\n                            pattern: 'require(\"module\/platform\/css\/platform.less\");',\n                            replacement: ''\n                        }\n                    ]\n                }\n            }\n        },\n\n        \/\/\u89e3\u7801less\n        less: {\n            development: {\n                options: {\n                    compress: true,\n                },\n                files: {\n                    \"zoro\/module\/main\/css\/base.css\": \"..\/views\/zoro\/module\/main\/css\/base.less\",\n\n                    \"zoro\/module\/robin\/css\/reset.css\": \"..\/views\/zoro\/module\/robin\/css\/reset.less\",\n                    \"zoro\/module\/robin\/css\/robin.css\": \"..\/views\/zoro\/module\/robin\/css\/robin.less\",\n                    \"zoro\/module\/robin\/cssv2\/reset.css\": \"..\/views\/zoro\/module\/robin\/cssv2\/reset.less\",\n                    \"zoro\/module\/robin\/cssv2\/robin.css\": \"..\/views\/zoro\/module\/robin\/cssv2\/robin.less\",\n\n                    \"zoro\/module\/files\/css\/file.css\": \"..\/views\/zoro\/module\/files\/css\/file.less\",\n                    \"zoro\/module\/files\/css\/linkman.css\": \"..\/views\/zoro\/module\/files\/css\/linkman.less\",\n                    \"zoro\/module\/files\/css\/receive.css\": \"..\/views\/zoro\/module\/files\/css\/receive.less\",\n                    \"zoro\/module\/files\/css\/recycle.css\": \"..\/views\/zoro\/module\/files\/css\/recycle.less\",\n                    \"zoro\/module\/files\/css\/share.css\": \"..\/views\/zoro\/module\/files\/css\/share.less\",\n\n                    \"zoro\/module\/platform\/css\/platform.css\": \"..\/views\/zoro\/module\/platform\/css\/platform.less\",\n\n                    \"zoro\/module\/download\/css\/styles.css\": \"..\/views\/zoro\/module\/download\/css\/styles.less\",\n                }\n            }\n        },\n        \/\/\u628a\u89e3\u7801\u597d\u7684css\u6587\u4ef6\u7ec4\u5408\u538b\u7f29\u6210\u4e00\u4e2a\u6587\u4ef6\uff0ccssmin\u662fCSS\u538b\u7f29\u5de5\u5177\n        cssmin: {\n            add_banner: {\n                options: {\n                    banner: '\/* 10 in one, view gruntfile.js *\/'\n                },\n                files: {\n                    'zoro\/module\/cssmin\/all.min.css': [\n                        \/\/ \"zoro\/module\/main\/css\/base.css\",\n                        \/\/ \"zoro\/module\/robin\/cssv2\/reset.css\",\n                        \"zoro\/module\/robin\/cssv2\/robin.css\",\n                        \"zoro\/module\/files\/css\/file.css\",\n                        \"zoro\/module\/files\/css\/linkman.css\",\n                        \"zoro\/module\/files\/css\/receive.css\",\n                        \"zoro\/module\/files\/css\/recycle.css\",\n                        \"zoro\/module\/files\/css\/share.css\",\n                        \"zoro\/module\/platform\/css\/platform.css\",\n                        \"zoro\/module\/download\/css\/styles.css\"\n                    ]   \n                }\n            }\n        },\n        \/\/uglify\u662fjs\u538b\u7f29\u5de5\u5177\n        uglify: {\n            options: {\n                mangle: false, \/\/\u4e0d\u6df7\u6dc6\u53d8\u91cf\u540d\n                preserveComments: 'all', \/\/\u4e0d\u5220\u9664\u6ce8\u91ca\uff0c\u8fd8\u53ef\u4ee5\u4e3a false\uff08\u5220\u9664\u5168\u90e8\u6ce8\u91ca\uff09\uff0csome\uff08\u4fdd\u7559@preserve @license @cc_on\u7b49\u6ce8\u91ca\uff09\n                banner: '\/*! &lt;%= grunt.template.today(\"yyyy-mm-dd\") %&gt; *\/\\n'\/\/\u6dfb\u52a0banner\n            },\n            buildall: {\/\/\u6309\u539f\u6587\u4ef6\u7ed3\u6784\u538b\u7f29js\u6587\u4ef6\u5939\u5185\u6240\u6709JS\u6587\u4ef6\n                files: [\n                    {\n                        expand: true,\n                        src: 'zoro\/module\/**\/*.js',\/\/\u6240\u6709js\u6587\u4ef6\n                        dest: ''\/\/\u751f\u6210\u7684\u6587\u4ef6\u5c31\u8f93\u51fa\u5230\u539f\u76ee\u5f55\u4e0b\n                    }\n                ]\n            },\n        }\n    });\n    \/\/ \u8f7d\u5165\u63d2\u4ef6\n    grunt.loadNpmTasks('grunt-contrib-copy');\n    grunt.loadNpmTasks('grunt-string-replace');\n    grunt.loadNpmTasks('grunt-contrib-less');\n    grunt.loadNpmTasks('grunt-contrib-cssmin');\n    grunt.loadNpmTasks('grunt-contrib-uglify');\n    \/\/ \u9ed8\u8ba4\u4efb\u52a1\n    grunt.registerTask('default', ['copy', 'string-replace', 'less', 'cssmin', 'uglify']);\n};<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Grunt\u662f\u57fa\u4e8eNode.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[33,78],"class_list":["post-956","post","type-post","status-publish","format-standard","hentry","category-web-frontend","tag-grunt","tag-78"],"_links":{"self":[{"href":"https:\/\/www.divis.cn\/index.php\/wp-json\/wp\/v2\/posts\/956","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.divis.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.divis.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.divis.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.divis.cn\/index.php\/wp-json\/wp\/v2\/comments?post=956"}],"version-history":[{"count":0,"href":"https:\/\/www.divis.cn\/index.php\/wp-json\/wp\/v2\/posts\/956\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.divis.cn\/index.php\/wp-json\/wp\/v2\/media?parent=956"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.divis.cn\/index.php\/wp-json\/wp\/v2\/categories?post=956"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.divis.cn\/index.php\/wp-json\/wp\/v2\/tags?post=956"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}