软件包管理器:Bower vs jspm [英] Package Manager: Bower vs jspm

查看:102
本文介绍了软件包管理器:Bower vs jspm的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

鲍尔 jspm ? Bower可以提供有关 SystemJS通用模块加载器的jspm功能吗?

How is Bower different than jspm? Can Bower provide jspm functionality about SystemJS universal module loader?

推荐答案

Well JSPM比Bower更大,更宏大。 Bower仅有一个用途-从Web将所需的源文件下载到硬盘。对于您作为消费者,凉亭无能为力。如果要从bower执行脚本文件,则需要为每个脚本文件创建脚本标签。

Well JSPM is much larger and ambitious project than Bower. Bower has only one purpose-to download source files you need from the web to your hard disk. For you as a consumer, bower doesn't do anything else. If you want to execute script files from bower, you need to create your script tags for each of them.

而jspm不仅是模块下载器。默认情况下,它会下载您提到的systemjs。 SystemJS的实现尽可能接近 https://whatwg.github.io/loader/ 。实际上,JSPM的作者是规范过程的非常积极的参与者。如今,借助systemjs,您无需构建ES6(通过在浏览器中编译它们),CommonJS或AMD模块即可。不仅是ES6模块,而且traceur / babeljs / typescript支持的所有其他ES6功能。根据运行 jspm init 时选择的编译器而定。 SystemJS在node.js和浏览器中均以1:1的方式工作,因此可以轻松完成应用程序的单元测试。

While jspm is not only a module downloader. It downloads by default systemjs that you have mentioned. SystemJS is implemented as closely to https://whatwg.github.io/loader/ as possible. Actually author of JSPM is very active participant of the specification process. With systemjs, today you are able to load ES6(by transpiling them in the browser), CommonJS or AMD modules in the browser without building them. Not only ES6 modules, but all the other ES6 features supported by traceur/babeljs/typescript. Depending on which compiler you choose when running jspm init. SystemJS works 1:1 in node.js as well as in browser, so unit testing your app is easily done.

它还可以为您构建捆绑包( jspm build )。因此,显然jspm(+ systemjs)是更强大的工具。
因此,根据经验:

Also it can build the bundle for you(jspm build) when you need to go to production. So it is obvious that jspm(+systemjs) is a more powerful tool. So as a rule of thumb:


  • 需要快速获取jquery并将其包含在服务器端模板html中吗?使用常规脚本标签。 Bower已被弃用。

  • 需要构建大型JS应用吗?使用Webpack。 JSPM无法达到临界质量,每个人现在都在做webpack。

这篇关于软件包管理器:Bower vs jspm的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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