咕噜分钟任务去了哪里? [英] Where did the grunt min task go?

查看:101
本文介绍了咕噜分钟任务去了哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用一些 min 任务的咕噜声中观看了许多教程。我找不到任何涉及类似任务的插件。我猜想开发者已经更新了它,并将其重命名为 uglify ,我是对吗?另一个问题是安装咕噜声。它可以在全球范围内安装吗?还是我应该在本地安装grunt-cli和grunt以便将其用于本地项目?



这个:

pre $ sudo npm install -g grunt

不适用于我,仅限


  sudo npm install -g grunt-cli 

npm install grunt --save-dev

第一种方法已被弃用吗?

编辑:



以下是我提到的视频: http://www.youtube .com / watch?v = q3Sqljpr-Vc

解决方案

有很多



你指的是一个to是uglify插件,但很难说不知道你正在观看哪个教程。



至于安装,第二种形式对于grunt 4.x是正确的,如文档


I watched many tutorials on grunt where some min task was used. I couldn't find any plugins referring to similar task. I would guess that devs have updated it and renamed to uglify am i right? And another issue i had was the installation of grunt. Can it still be installed globally, or should i install grunt-cli globally and grunt locally in order to use it for my local projects??

This:

sudo npm install -g grunt

doesn't work for me, only:

sudo npm install -g grunt-cli

npm install grunt --save-dev

Is the first method deprecated?

Edit:

Here is the video i'm refering to: http://www.youtube.com/watch?v=q3Sqljpr-Vc

解决方案

There are many different min libraries including these by the core grunt team:

  • grunt-contrib-cssmin (grunt-contrib-mincss is the older version)
  • grunt-contrib-htmlmin
  • grunt-contrib-imagemin
  • grunt-contrib-uglify <== for js minification

It is likely the one you are referring to is the uglify plugin, but hard to tell without knowing which tutorial you were watching.

As to installing, the second form is correct for grunt 4.x as described in the documentation

这篇关于咕噜分钟任务去了哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆