So I've been reading about Gulp and Grunt, and how they can minify code, compress files, combine files into one, livereload etc. However, Meteor does all that already, with Isobuild.
所以我一直在阅读Gulp和Grunt,以及如何缩小代码,压缩文件,将文件组合成一个,livereload等等。但是,Meteor已经完成了所有这些,使用Isobuild。
The reason I'm asking is someone suggested using Gulp with Meteor, and I don't see a need for it. What are some possible reasons why I should run Gulp alongside Meteor? Or it is simply redundant?
我问的原因是有人建议使用Gulp和Meteor,我认为不需要它。我应该和Meteor一起运行Gulp的原因是什么?或者它只是多余的?
If it is not redundant, what features does Gulp has that is not in Isobuild? And will the Meteor team plan to incorporate Gulp into its next versions?
如果它不是多余的,Gulp有哪些功能不在Isobuild中? Meteor团队是否计划将Gulp纳入其下一版本?
1 个解决方案
#1
31
Need is probably not the right word. Whether you want it or not is a different story.
需要可能不是正确的词。无论你是否想要它都是一个不同的故事。
As the comments mentioned above, Meteor include a very clever build system of its own called isobuild, which builds your WHOLE application for you. But there are certainly instances where you may want your own tasks which would best be accomplished through grunt or gulp. (The range of tasks you can accomplish with these is staggering, so I'm only going to list a couple simple common examples.)
正如上面提到的评论,Meteor包含一个非常聪明的构建系统,称为isobuild,它为您构建您的WHOLE应用程序。但有些情况下,您可能需要自己的任务,最好通过咕噜咕噜或咕噜咕噜咕噜咕(你可以用这些完成的任务范围是惊人的,所以我只列出几个简单的常见例子。)
The most obvious is going to be for assets you want to put in your public folder. But this is far from an exhaustive list of tasks that you may want to automate on a larger project.
最明显的是要放在公用文件夹中的资产。但这远不是您可能希望在较大项目上自动化的详尽任务列表。
- Compile SASS files not using the libsass compiler (because it doesn't support all the features)
- 不使用libsass编译器编译SASS文件(因为它不支持所有功能)
- Compress and optimize images, svg files, favicons, etc.
- 压缩和优化图像,svg文件,favicon等。
- Create multiple sizes / versions of images
- 创建多个尺寸/版本的图像
- Create Sprite Sheets
- 创建精灵表
- Concatenate and minify scripts in your own order / manner
- 以您自己的顺序/方式连接和缩小脚本
- Combine with Bower to manage front end packages that aren't available through atmosphere etc.
- 与Bower结合,管理大气等无法提供的前端包装。
The way I would approach it is by putting all of this into the private folder, so its avoided by the meteor isobuild build system.
我接近它的方法是将所有这些放入私人文件夹,因此它可以通过流星isobuild构建系统来避免。
I believe these are enough reasons to not consider Gulp or Grunt redundant, and the range of tasks possible with grunt or gulp are so varied they can't all be listed here. Needless to say IsoBuild is fantastic for what it does, but would not replace everything possible with these task runners, and to my knowledge there are no plans to incorporate Gulp into IsoBuild. IsoBuild is core to what Meteor is, gulp and grunt are very powerful automation tools with thousands of possible uses.
我相信这些都是不考虑Gulp或Grunt冗余的充分理由,并且grunt或gulp可能的任务范围如此多样化,它们不能全部列在这里。毋庸置疑,IsoBuild对它的功能非常出色,但不会用这些任务运行器取代所有可能的东西,据我所知,没有计划将Gulp整合到IsoBuild中。 IsoBuild是Meteor的核心,gulp和grunt是非常强大的自动化工具,具有数千种可能的用途。
Heres a really great starter for gulp, its super simple to get started with: NodeJitsu Gulp tutorial
对于gulp来说,这是一个非常棒的入门者,它的开始非常简单:NodeJitsu Gulp教程
So, sure, you don't need grunt or gulp, but they could certainly have a productive place in your meteor project and they're definitely worthwhile tools to get to grips with to streamline your dev processes.
所以,当然,你不需要咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜声。
If you would like to use either grunt or gulp, this is how I approach structure my project:
如果您想使用grunt或gulp,这就是我处理项目结构的方法:
Project-folder
|__ webapp // my meteor app lives here
|__ assets // scss / images / svgs
|__ node_modules
| gruntfile.js
| .eslintrc
| package.json
I then build, minify, and process my assets, with my target directories in webapp/public
然后我使用webapp / public中的目标目录构建,缩小和处理我的资产
Note that with full npm support coming in Meteor@1.3 this may change, though I'm unclear about whether we'll be able to mvoe this into the project yet.
请注意,在Meteor@1.3中提供完整的npm支持,这可能会有所改变,但我不清楚我们是否能够将其纳入项目中。
#1
31
Need is probably not the right word. Whether you want it or not is a different story.
需要可能不是正确的词。无论你是否想要它都是一个不同的故事。
As the comments mentioned above, Meteor include a very clever build system of its own called isobuild, which builds your WHOLE application for you. But there are certainly instances where you may want your own tasks which would best be accomplished through grunt or gulp. (The range of tasks you can accomplish with these is staggering, so I'm only going to list a couple simple common examples.)
正如上面提到的评论,Meteor包含一个非常聪明的构建系统,称为isobuild,它为您构建您的WHOLE应用程序。但有些情况下,您可能需要自己的任务,最好通过咕噜咕噜或咕噜咕噜咕噜咕(你可以用这些完成的任务范围是惊人的,所以我只列出几个简单的常见例子。)
The most obvious is going to be for assets you want to put in your public folder. But this is far from an exhaustive list of tasks that you may want to automate on a larger project.
最明显的是要放在公用文件夹中的资产。但这远不是您可能希望在较大项目上自动化的详尽任务列表。
- Compile SASS files not using the libsass compiler (because it doesn't support all the features)
- 不使用libsass编译器编译SASS文件(因为它不支持所有功能)
- Compress and optimize images, svg files, favicons, etc.
- 压缩和优化图像,svg文件,favicon等。
- Create multiple sizes / versions of images
- 创建多个尺寸/版本的图像
- Create Sprite Sheets
- 创建精灵表
- Concatenate and minify scripts in your own order / manner
- 以您自己的顺序/方式连接和缩小脚本
- Combine with Bower to manage front end packages that aren't available through atmosphere etc.
- 与Bower结合,管理大气等无法提供的前端包装。
The way I would approach it is by putting all of this into the private folder, so its avoided by the meteor isobuild build system.
我接近它的方法是将所有这些放入私人文件夹,因此它可以通过流星isobuild构建系统来避免。
I believe these are enough reasons to not consider Gulp or Grunt redundant, and the range of tasks possible with grunt or gulp are so varied they can't all be listed here. Needless to say IsoBuild is fantastic for what it does, but would not replace everything possible with these task runners, and to my knowledge there are no plans to incorporate Gulp into IsoBuild. IsoBuild is core to what Meteor is, gulp and grunt are very powerful automation tools with thousands of possible uses.
我相信这些都是不考虑Gulp或Grunt冗余的充分理由,并且grunt或gulp可能的任务范围如此多样化,它们不能全部列在这里。毋庸置疑,IsoBuild对它的功能非常出色,但不会用这些任务运行器取代所有可能的东西,据我所知,没有计划将Gulp整合到IsoBuild中。 IsoBuild是Meteor的核心,gulp和grunt是非常强大的自动化工具,具有数千种可能的用途。
Heres a really great starter for gulp, its super simple to get started with: NodeJitsu Gulp tutorial
对于gulp来说,这是一个非常棒的入门者,它的开始非常简单:NodeJitsu Gulp教程
So, sure, you don't need grunt or gulp, but they could certainly have a productive place in your meteor project and they're definitely worthwhile tools to get to grips with to streamline your dev processes.
所以,当然,你不需要咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜声。
If you would like to use either grunt or gulp, this is how I approach structure my project:
如果您想使用grunt或gulp,这就是我处理项目结构的方法:
Project-folder
|__ webapp // my meteor app lives here
|__ assets // scss / images / svgs
|__ node_modules
| gruntfile.js
| .eslintrc
| package.json
I then build, minify, and process my assets, with my target directories in webapp/public
然后我使用webapp / public中的目标目录构建,缩小和处理我的资产
Note that with full npm support coming in Meteor@1.3 this may change, though I'm unclear about whether we'll be able to mvoe this into the project yet.
请注意,在Meteor@1.3中提供完整的npm支持,这可能会有所改变,但我不清楚我们是否能够将其纳入项目中。