{"id":170937,"date":"2013-02-27T14:22:03","date_gmt":"2013-02-27T10:22:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=170937"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=170937","title":{"rendered":"<span class=\"post_title\">\u041c\u0438\u0433\u0440\u0430\u0446\u0438\u044f \u043d\u0430 Grunt v0.4<\/span>"},"content":{"rendered":"<div class=\"content html_format\">\n<h4>\u041f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435<\/h4>\n<p>  18 \u0444\u0435\u0432\u0440\u0430\u043b\u044f \u0432\u044b\u0448\u0435\u043b <a href=\"http:\/\/gruntjs.com\/blog\/2013-02-18-grunt-0.4.0-released\">\u0440\u0435\u043b\u0438\u0437 Grunt v0.4.0<\/a>, \u0441 \u0447\u0435\u043c \u0432\u0441\u0435\u0445 \u0438 \u043f\u043e\u0437\u0434\u0440\u0430\u0432\u043b\u044f\u044e. \u0415\u0441\u043b\u0438 \u0432\u044b \u0435\u0449\u0435 \u043d\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441 \u0413\u0440\u0430\u043d\u0442\u043e\u043c \u2014 \u043f\u0440\u043e\u0448\u0443 \u043f\u0440\u043e\u0439\u0442\u0438 \u043d\u0430 <a href=\"http:\/\/gruntjs.com\/\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0430\u0439\u0442<\/a> \u0438\u043b\u0438 \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"http:\/\/habrahabr.ru\/post\/148274\/\">\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u043d\u0430 \u0425\u0430\u0431\u0440\u0435<\/a>. \u0412\u043a\u0440\u0430\u0442\u0446\u0435, \u0413\u0440\u0430\u043d\u0442 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043a\u043b\u0435\u0438\u0432\u0430\u043d\u0438\u0435 \u0438 \u043c\u0438\u043d\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e js-\u0444\u0430\u0439\u043b\u043e\u0432, \u0437\u0430\u043f\u0443\u0441\u043a \u0442\u0435\u0441\u0442\u043e\u0432, \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043a\u043e\u0434\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e JSHint \u0438 <a href=\"http:\/\/gruntjs.com\/plugins\">\u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435<\/a>.<\/p>\n<p>  \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u2014 \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u0413\u0440\u0430\u043d\u0442\u0430 v0.3.9 \u043d\u0430 \u0432\u044b\u0448\u0435\u0434\u0448\u0443\u044e v0.4.0. \u0412\u0435\u0440\u0441\u0438\u0438 \u043d\u0435\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b \u0438 \u043f\u0435\u0440\u0435\u0435\u0437\u0434 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043d\u0435 \u0442\u0430\u043a\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0434\u0435\u043b\u043e\u043c, \u043a\u0430\u043a \u044f \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u043b. \u041f\u043e\u043b\u043d\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u043e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f <a href=\"http:\/\/gruntjs.com\/upgrading-from-0.3-to-0.4\">\u0437\u0434\u0435\u0441\u044c<\/a>, \u043e\u043d\u0430 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0447\u0435\u043c \u043c\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435.<\/p>\n<h4>\u0417\u0430\u0447\u0435\u043c \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e Grunt<\/h4>\n<p>  \u041a\u0430\u043a \u043b\u044e\u0431\u043e\u043c\u0443 \u043b\u0435\u043d\u0438\u0432\u043e\u043c\u0443 frontend-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443, \u043c\u043d\u0435 \u043d\u0443\u0436\u0435\u043d \u0431\u044b\u043b \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0440\u0443\u0442\u0438\u043d\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044f \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u0442\u044c\u0441\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435. \u0422\u0430\u043a \u044f \u043d\u0430\u0448\u0435\u043b \u0413\u0440\u0430\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0435\u043b\u0430\u043b \u0437\u0430 \u043c\u0435\u043d\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<ul>\n<li>\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f <a href=\"http:\/\/learnboost.github.com\/stylus\/\">stylus<\/a> \u0432 css;<\/li>\n<li>\u0441\u043a\u043b\u0435\u0438\u0432\u0430\u043d\u0438\u0435 js-\u0444\u0430\u0439\u043b\u043e\u0432;<\/li>\n<li>\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 JavaScript \u043b\u0438\u043d\u0442\u0435\u0440\u043e\u043c;<\/li>\n<li>\u043c\u0438\u043d\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0441\u043a\u043b\u0435\u0435\u043d\u043d\u044b\u0445 js-\u0444\u0430\u0439\u043b\u043e\u0432;<\/li>\n<li>\u0437\u0430\u043f\u0443\u0441\u043a unit-\u0442\u0435\u0441\u0442\u043e\u0432 (<a href=\"http:\/\/qunitjs.com\/\">qUnit<\/a>);<\/li>\n<li>\u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a \u0432\u044b\u0448\u0435\u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447.<\/li>\n<\/ul>\n<p><a name=\"habracut\"><\/a><\/p>\n<p>  \u0412\u0441\u0435 \u044d\u0442\u0438 \u0432\u0430\u0436\u043d\u044b\u0435, \u043d\u043e \u0441\u043a\u0443\u0447\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0438\u0441\u044c \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code class=\"bash\">\u2192 grunt Running &quot;stylus:compile&quot; (stylus) task File 'css\/styles.css' created.   Running &quot;concat:js&quot; (concat) task File &quot;project.js&quot; created.   Running &quot;lint:files&quot; (lint) task Lint free.   Running &quot;min:js&quot; (min) task File &quot;project.min.js&quot; created. Uncompressed size: 130468 bytes. Compressed size: 20937 bytes gzipped (74246 bytes minified).   Running &quot;qunit:all&quot; (qunit) task Testing index.html...............OK &gt;&gt; 95 assertions passed (594ms)   Running &quot;watch&quot; task Waiting...<\/code><\/pre>\n<p>  \u0412\u0441\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0433\u0440\u0430\u043d\u0442-\u0444\u0430\u0439\u043b\u0435: grunt.js. \u0414\u043b\u044f \u0432\u044b\u0448\u0435\u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u043b\u043e\u0433\u0430 \u043e\u043d \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u0447\u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"javascript\">module.exports = function(grunt) { \tgrunt.initConfig({ \t\tstylus: { \t\t\t\/\/ \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f Stylus \u0432 CSS \t\t\tcompile: { \t\t\t\toptions: { \t\t\t\t\t'compress': true, \t\t\t\t\t'paths': ['css\/styl\/'] \t\t\t\t}, \t\t\t\tfiles: { \t\t\t\t\t'css\/styles.css': 'css\/styles.styl' \t\t\t\t} \t\t\t} \t\t}, \t\tconcat: { \t\t\t\/\/ \u0421\u043a\u043b\u0435\u0438\u0432\u0430\u043d\u0438\u0435 js-\u0444\u0430\u0439\u043b\u043e\u0432 \t\t\tjs: { \t\t\t\tsrc: [ \t\t\t\t\t\/* \u0417\u0434\u0435\u0441\u044c \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0444\u0430\u0439\u043b\u043e\u0432 *\/ \t\t\t\t], \t\t\t\tdest: 'project.js' \t\t\t} \t\t}, \t\tmin: { \t\t\t\/\/ \u041c\u0438\u043d\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \t\t\tjs: { \t\t\t\tsrc: ['&lt;config:concat.js.dest&gt;'], \t\t\t\tdest: 'project.min.js' \t\t\t} \t\t}, \t\tjshint: { \t\t\toptions: { \t\t\t\tsmarttabs: true \t\t\t} \t\t}, \t\tlint: { \t\t\t\/\/ \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043a\u043e\u0434\u0430 \t\t\tfiles: ['&lt;config:concat.js.dest&gt;'] \t\t}, \t\twatch: { \t\t\t\/\/ \u041f\u0435\u0440\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u0441\u0442\u0438\u043b\u0435\u0439 \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 styl-\u0444\u0430\u0439\u043b\u043e\u0432 \t\t\tstylus: { \t\t\t\tfiles: ['css\/styl\/*.styl'], \t\t\t\ttasks: 'stylus' \t\t\t}, \t\t\t\/\/ \u041f\u0435\u0440\u0435\u0441\u043e\u0431\u0438\u0440\u0430\u043d\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a lint \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 js-\u0444\u0430\u0439\u043b\u043e\u0432 \t\t\tjs: { \t\t\t\tfiles: ['src\/*.js'], \t\t\t\ttasks: 'concat lint' \t\t\t} \t\t}, \t\tqunit: { \t\t\t\/\/ \u0417\u0430\u043f\u0443\u0441\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 qUnit-\u0442\u0435\u0441\u0442\u043e\u0432 \t\t\tall: ['..\/test\/index.html'] \t\t} \t});  \t\/\/ \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043c\u043e\u0434\u0443\u043b\u044f \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0421\u0442\u0438\u043b\u0443\u0441\u0430 \tgrunt.loadNpmTasks('grunt-stylus');  \t\/\/ \u041e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u0430\u0441\u043a\u043e\u0432 \tgrunt.registerTask('default', 'stylus concat:js lint min:js qunit watch'); \tgrunt.registerTask('test', 'qunit'); }; <\/code><\/pre>\n<p>  \u041d\u0435 \u0431\u0443\u0434\u0443 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0435\u0433\u043e \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c, \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u0432 \u043a\u043e\u0434\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e.<\/p>\n<h4>\u041c\u0438\u0433\u0440\u0430\u0446\u0438\u044f<\/h4>\n<p>  <\/p>\n<h5>\u041f\u0435\u0440\u0435\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043c\u043e\u0434\u0443\u043b\u044f<\/h5>\n<p>  \u0420\u0430\u043d\u0435\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e \u043c\u043e\u0434\u0443\u043b\u044c grunt (\u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0432\u043e\u0439 \u0438\u043c\u0435\u0435\u0442\u0441\u044f) \u0443\u0434\u0430\u043b\u044f\u0435\u043c: <code>npm uninstall -g grunt<\/code><\/p>\n<p>  \u0418 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c <a href=\"https:\/\/github.com\/gruntjs\/grunt-cli\">\u043c\u043e\u0434\u0443\u043b\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0413\u0440\u0430\u043d\u0442\u0430<\/a>: <code>npm install -g grunt-cli<\/code><\/p>\n<p>  \u0421\u0430\u043c grunt \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u0442\u0430\u0432\u0438\u0442\u0441\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0432 \u043f\u0430\u043f\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430: <code>npm install grunt<\/code><\/p>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0432\u0435\u0440\u0441\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439:<\/p>\n<pre><code class=\"bash\">\u2192 grunt --version grunt-cli v0.1.6 grunt v0.4.0 <\/code><\/pre>\n<p>  \u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c grunt-init, \u043d\u043e \u0432 \u043c\u043e\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043e\u043d \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f.<\/p>\n<p>  \u041f\u0435\u0440\u0435\u0434 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u043e\u0439 \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0432\u0435\u0440\u0441\u0438\u044f node.js &gt;= 0.8.0.<\/p>\n<h5>\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0433\u0440\u0430\u043d\u0442-\u0444\u0430\u0439\u043b\u0430<\/h5>\n<p>  <\/p>\n<pre><code class=\"bash\"> mv grunt.js Gruntfile.js <\/code><\/pre>\n<p>  \u0413\u0440\u0430\u043d\u0442-\u0444\u0430\u0439\u043b \u0441\u043e \u0441\u0442\u0430\u0440\u044b\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u0443\u0432\u0438\u0434\u0438\u043c \u043e\u0448\u0438\u0431\u043a\u0443:<\/p>\n<p>  <code>Fatal error: Unable to find Gruntfile.<\/code><\/p>\n<p>  \u0412 \u043d\u043e\u0432\u043e\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u0433\u0440\u0430\u043d\u0442-\u0444\u0430\u0439\u043b \u043c\u043e\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 <a href=\"http:\/\/coffeescript.org\/\">CoffeeScript<\/a>: Gruntfile.coffee.<\/p>\n<h5>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432<\/h5>\n<p>  \u0423 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0413\u0440\u0430\u043d\u0442\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a concat, min, watch \u0438 \u0434\u0440. \u0418\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 <a href=\"http:\/\/gruntjs.com\/plugins\">\u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432<\/a>:<\/p>\n<ul>\n<li>concat \u2192 grunt-contrib-concat<\/li>\n<li>lint \u2192 grunt-contrib-jshint<\/li>\n<li>min \u2192 grunt-contrib-uglify<\/li>\n<li>qunit \u2192 grunt-contrib-qunit<\/li>\n<li>watch \u2192 grunt-contrib-watch<\/li>\n<\/ul>\n<p>  \u041d\u0435\u0441\u043b\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u044b \u0413\u0440\u0430\u043d\u0442\u0430 \u0438\u043c\u0435\u044e\u0442 \u043f\u0440\u0435\u0444\u0438\u043a\u0441 grunt-contrib-.<br \/>  \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c:<\/p>\n<pre><code class=\"bash\">\u2192 npm install grunt-contrib-concat \u2192 npm install grunt-contrib-jshint \u2192 npm install grunt-contrib-uglify \u2192 npm install grunt-contrib-qunit \u2192 npm install grunt-contrib-watch \u2192 npm install grunt-contrib-stylus <\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>--save-dev<\/code>, \u0447\u0442\u043e\u0431\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u043b\u0438\u0441\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 devDependencies \u0432 package.json.<\/p>\n<p>  \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043f\u043b\u0430\u0433\u0438\u043d\u044b \u0432 \u0433\u0440\u0430\u043d\u0442-\u0444\u0430\u0439\u043b\u0435:<\/p>\n<pre><code class=\"javascript\">grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-qunit'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-stylus'); <\/code><\/pre>\n<p>  <\/p>\n<h5>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0433\u0440\u0430\u043d\u0442-\u0444\u0430\u0439\u043b\u0435<\/h5>\n<p>  \u041c\u0435\u0442\u043e\u0434\u0443 registerTask \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043b\u044c\u0437\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u0434\u0430\u0447 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439 \u0441 \u043f\u0440\u043e\u0431\u0435\u043b\u0430\u043c\u0438-\u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044f\u043c\u0438. \u0421\u0442\u0440\u043e\u043a\u043e\u0439 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0443 \u0437\u0430\u0434\u0430\u0447\u0443: <code>grunt.registerTask('test', 'qunit');<\/code><\/p>\n<p>  \u0414\u043b\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u0437\u0430\u0434\u0430\u0447 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432:<\/p>\n<pre><code class=\"javascript\">grunt.registerTask('default', ['stylus', 'concat:js', 'jshint', 'min:js', 'qunit', 'watch']); <\/code><\/pre>\n<p>  \u0412\u043c\u0435\u0441\u0442\u043e \u0434\u0435\u0440\u0435\u043a\u0442\u0438\u0432 \u0432\u0438\u0434\u0430 <code>&lt;config:concat.js.dest&gt;<\/code> \u0442\u0435\u043f\u0435\u0440\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u044b: <code>&lt;%= concat.js.dest %&gt;<\/code>.<\/p>\n<p>  \u0417\u0430\u0434\u0430\u0447\u0430 lint \u0441 \u043e\u043f\u0446\u0438\u044f\u043c\u0438 jshint \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0430 \u0432 \u0437\u0430\u0434\u0430\u0447\u0443 jshint, \u0433\u0434\u0435 \u0441\u0440\u0430\u0437\u0443 \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043e\u043f\u0446\u0438\u0438:<\/p>\n<pre><code class=\"javascript\">jshint: { \toptions: { \t\tsmarttabs: true \t}, \tjs: ['project.js'] } <\/code><\/pre>\n<p>  \u0417\u0430\u0434\u0430\u0447\u0443 min \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u0432 uglify. \u0412\u043c\u0435\u0441\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 src\/dest \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 files:<\/p>\n<pre><code class=\"javascript\">uglify: { \tjs: { \t\tfiles: { \t\t\t'project.min.js': ['&lt;%= concat.js.dest %&gt;'] \t\t} \t} } <\/code><\/pre>\n<p>  \u0412 \u0437\u0430\u0434\u0430\u0447\u0435 watch \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0435 \u0442\u0430\u0441\u043a\u0438 \u0432 \u0432\u0438\u0434\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430:<\/p>\n<pre><code class=\"javascript\">watch: { \tjs: { \t\tfiles: ['src\/*.js'], \t\ttasks: ['concat', 'lint'] \t} } <\/code><\/pre>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u043c\u043e\u0439 \u043f\u0435\u0440\u0435\u0435\u0437\u0434 \u0431\u044b\u043b \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d, \u0438 \u0413\u0440\u0430\u043d\u0442 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0431\u0435\u0437 \u043e\u0448\u0438\u0431\u043e\u043a. \u0412\u0441\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0433\u0440\u0430\u043d\u0442-\u0444\u0430\u0439\u043b\u0430 \u0441\u043e\u0431\u0440\u0430\u043d\u044b \u0432 \u044d\u0442\u043e\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u0435: <\/p>\n<pre><code class=\"javascript\">module.exports = function(grunt) { \tgrunt.initConfig({ \t\t\/\/ \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f Stylus \u0432 CSS \t\tstylus: { \t\t\tcompile: { \t\t\t\toptions: { \t\t\t\t\t'compress': true, \t\t\t\t\t'paths': ['css\/styl\/'] \t\t\t\t}, \t\t\t\tfiles: { \t\t\t\t\t'css\/styles.css': 'css\/styles.styl' \t\t\t\t} \t\t\t} \t\t}, \t\tconcat: { \t\t\t\/\/ \u0421\u043a\u043b\u0435\u0438\u0432\u0430\u043d\u0438\u0435 js-\u0444\u0430\u0439\u043b\u043e\u0432 \t\t\tjs: { \t\t\t\tsrc: [ \t\t\t\t\t\/* \u0417\u0434\u0435\u0441\u044c \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0444\u0430\u0439\u043b\u043e\u0432 *\/ \t\t\t\t], \t\t\t\tdest: 'project.js' \t\t\t} \t\t}, \t\tuglify: { \t\t\t\/\/ \u041c\u0438\u043d\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \t\t\tjs: { \t\t\t\tfiles: { \t\t\t\t\t'project.min.js': ['&lt;%= concat.js.dest %&gt;'] \t\t\t\t} \t\t\t} \t\t}, \t\tjshint: { \t\t\t\/\/ \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043a\u043e\u0434\u0430 \t\t\toptions: { \t\t\t\tsmarttabs: true \t\t\t}, \t\t\tjs: ['&lt;%= concat.js.dest %&gt;'] \t\t}, \t\twatch: { \t\t\t\/\/ \u041f\u0435\u0440\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u0441\u0442\u0438\u043b\u0435\u0439 \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 styl-\u0444\u0430\u0439\u043b\u043e\u0432 \t\t\tstylus: { \t\t\t\tfiles: ['css\/styl\/*.styl'], \t\t\t\ttasks: 'stylus' \t\t\t}, \t\t\t\/\/ \u041f\u0435\u0440\u0435\u0441\u043e\u0431\u0438\u0440\u0430\u043d\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a lint \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 js-\u0444\u0430\u0439\u043b\u043e\u0432 \t\t\tjs: { \t\t\t\tfiles: ['src\/*.js'], \t\t\t\ttasks: ['concat', 'lint'] \t\t\t} \t\t}, \t\tqunit: { \t\t\t\/\/ \u0417\u0430\u043f\u0443\u0441\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 qUnit-\u0442\u0435\u0441\u0442\u043e\u0432 \t\t\tall: ['..\/test\/index.html'] \t\t} \t});  \tgrunt.loadNpmTasks('grunt-contrib-concat'); \tgrunt.loadNpmTasks('grunt-contrib-jshint'); \tgrunt.loadNpmTasks('grunt-contrib-uglify'); \tgrunt.loadNpmTasks('grunt-contrib-qunit'); \tgrunt.loadNpmTasks('grunt-contrib-watch'); \tgrunt.loadNpmTasks('grunt-contrib-stylus');  \t\/\/ \u041e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u0430\u0441\u043a\u043e\u0432 \tgrunt.registerTask('default', ['stylus', 'concat:js', 'jshint', 'uglify:js', 'qunit', 'watch']); \tgrunt.registerTask('test', 'qunit'); }; <\/code><\/pre>\n<h5>\u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b \u043f\u043e \u0442\u0435\u043c\u0435<\/h5>\n<p>  <\/p>\n<ul>\n<li><a href=\"http:\/\/gruntjs.com\/upgrading-from-0.3-to-0.4\">Upgrading from 0.3 to 0.4<\/a><\/li>\n<li><a href=\"http:\/\/nano.sapegin.ru\/all\/grunt-0-4\/\">Grunt 0.4: \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 \u0434\u043b\u044f \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432<\/a><\/li>\n<\/ul>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/170937\/\"> http:\/\/habrahabr.ru\/post\/170937\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">\n<h4>\u041f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435<\/h4>\n<p>  18 \u0444\u0435\u0432\u0440\u0430\u043b\u044f \u0432\u044b\u0448\u0435\u043b <a href=\"http:\/\/gruntjs.com\/blog\/2013-02-18-grunt-0.4.0-released\">\u0440\u0435\u043b\u0438\u0437 Grunt v0.4.0<\/a>, \u0441 \u0447\u0435\u043c \u0432\u0441\u0435\u0445 \u0438 \u043f\u043e\u0437\u0434\u0440\u0430\u0432\u043b\u044f\u044e. \u0415\u0441\u043b\u0438 \u0432\u044b \u0435\u0449\u0435 \u043d\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441 \u0413\u0440\u0430\u043d\u0442\u043e\u043c \u2014 \u043f\u0440\u043e\u0448\u0443 \u043f\u0440\u043e\u0439\u0442\u0438 \u043d\u0430 <a href=\"http:\/\/gruntjs.com\/\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0430\u0439\u0442<\/a> \u0438\u043b\u0438 \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"http:\/\/habrahabr.ru\/post\/148274\/\">\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u043d\u0430 \u0425\u0430\u0431\u0440\u0435<\/a>. \u0412\u043a\u0440\u0430\u0442\u0446\u0435, \u0413\u0440\u0430\u043d\u0442 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043a\u043b\u0435\u0438\u0432\u0430\u043d\u0438\u0435 \u0438 \u043c\u0438\u043d\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e js-\u0444\u0430\u0439\u043b\u043e\u0432, \u0437\u0430\u043f\u0443\u0441\u043a \u0442\u0435\u0441\u0442\u043e\u0432, \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043a\u043e\u0434\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e JSHint \u0438 <a href=\"http:\/\/gruntjs.com\/plugins\">\u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435<\/a>.<\/p>\n<p>  \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u2014 \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u0413\u0440\u0430\u043d\u0442\u0430 v0.3.9 \u043d\u0430 \u0432\u044b\u0448\u0435\u0434\u0448\u0443\u044e v0.4.0. \u0412\u0435\u0440\u0441\u0438\u0438 \u043d\u0435\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b \u0438 \u043f\u0435\u0440\u0435\u0435\u0437\u0434 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043d\u0435 \u0442\u0430\u043a\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0434\u0435\u043b\u043e\u043c, \u043a\u0430\u043a \u044f \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u043b. \u041f\u043e\u043b\u043d\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u043e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f <a href=\"http:\/\/gruntjs.com\/upgrading-from-0.3-to-0.4\">\u0437\u0434\u0435\u0441\u044c<\/a>, \u043e\u043d\u0430 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0447\u0435\u043c \u043c\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435.<\/p>\n<h4>\u0417\u0430\u0447\u0435\u043c \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e Grunt<\/h4>\n<p>  \u041a\u0430\u043a \u043b\u044e\u0431\u043e\u043c\u0443 \u043b\u0435\u043d\u0438\u0432\u043e\u043c\u0443 frontend-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443, \u043c\u043d\u0435 \u043d\u0443\u0436\u0435\u043d \u0431\u044b\u043b \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0440\u0443\u0442\u0438\u043d\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044f \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u0442\u044c\u0441\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435. \u0422\u0430\u043a \u044f \u043d\u0430\u0448\u0435\u043b \u0413\u0440\u0430\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0435\u043b\u0430\u043b \u0437\u0430 \u043c\u0435\u043d\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<ul>\n<li>\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f <a href=\"http:\/\/learnboost.github.com\/stylus\/\">stylus<\/a> \u0432 css;<\/li>\n<li>\u0441\u043a\u043b\u0435\u0438\u0432\u0430\u043d\u0438\u0435 js-\u0444\u0430\u0439\u043b\u043e\u0432;<\/li>\n<li>\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 JavaScript \u043b\u0438\u043d\u0442\u0435\u0440\u043e\u043c;<\/li>\n<li>\u043c\u0438\u043d\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0441\u043a\u043b\u0435\u0435\u043d\u043d\u044b\u0445 js-\u0444\u0430\u0439\u043b\u043e\u0432;<\/li>\n<li>\u0437\u0430\u043f\u0443\u0441\u043a unit-\u0442\u0435\u0441\u0442\u043e\u0432 (<a href=\"http:\/\/qunitjs.com\/\">qUnit<\/a>);<\/li>\n<li>\u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a \u0432\u044b\u0448\u0435\u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447.<\/li>\n<\/ul>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-170937","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/170937","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=170937"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/170937\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=170937"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=170937"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=170937"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}