使用Javascript框架没有像grunt和gulp这样的构建工具? [英] Use Javascript frameworks without build tools like grunt and gulp?

查看:139
本文介绍了使用Javascript框架没有像grunt和gulp这样的构建工具?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了一些现代的Javascript框架,如Angular,React,Vue和Ember,他们都希望我使用构建工具,比如 npm grunt gulp maven 等。

Web编程过去很有趣。只需更改一些文件,刷新浏览器并查看它是否有效。现在每当我改变一些东西时,我都要重新构建它,这需要相当长的一段时间。我真的很讨厌看到网络编程已经变成这样。我知道建筑物甚至可以通过这些工具自动完成文件更改等工作,但仍然很糟糕。



我的问题是,当我想要使用上述框架之一,我是否应该在每次运行时都使用构建工具,还是仅仅为了部署和测试的目的而使用这些构建工具?(或根本不需要)?

解决方案

您不必使用这些工具。它们主要针对想要在较大项目中使用框架的人员,并且具有可让您将数百个JS组件编译成一个文件的功能。我个人主要使用它们来自动化构建测试,单元测试,并在发布日将所有资产捆绑在一起。让我们一次性讨论您提到的框架:

React :React在其入门页面上提供了已编译的代码版本< br>
AngularJS :与反应相同,只包含一个文件,只需查找angular cdn

Vue :他们也有一个你可以包含的文件。

Ember :见上面



对于大多数框架,你可以只需查看框架名称 CDN即可获得一个在线托管的js文件,您可以以旧的方式快速投入您的项目以进行Web开发。


I'm trying out some modern Javascript frameworks like Angular, React, Vue and Ember, and they all want me to use build tools like npm, grunt, gulp, maven, etc.

Web-programming used to be fun. Just change some files, refresh the browser and see if it works. Now every time I change something, I have to build it again, which takes quite some time. I really hate to see that web-programming has become like this. I know the building can even be done automatically with these tools watching for file-changes, etc., but still, it just sucks.

My question is, when I want to use one of the mentioned frameworks, am I supposed to use the build-tools every time I want to run, or do I just need these for deployment and testing purposes (or not at all) ?

解决方案

You don't have to use these tools. They're mostly aimed at people who want to use frameworks in larger projects, and have features that let you compile hundreds of JS components into one file. I personally use them mostly for automating build tests, unit tests, and bundling all the assets together on release days. Let's address the frameworks you mentioned one at a time:

React: React provides an already compiled version of their code on their getting started page
AngularJS: Same as react, there's just a file you can include, just look up "angular cdn"
Vue: They also have a file that you can just include.
Ember: See above

For most frameworks, you can just look up "name of framework CDN" to get an online hosted js file that you can quickly throw in to your projects for web development the old way.

这篇关于使用Javascript框架没有像grunt和gulp这样的构建工具?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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