This is exactly what Chillingworth failed to do. Browserify 和Webpack都定义了process.我记得当时我看到Browserify ,并盯着它的标语:. At the time I remember coming across Browserify and staring at its tagline:. Browserify ,由于其简单的特性,通常深受node.js开发者的喜爱。Browserify , because of its simplicity is usually loved by node. js developers.一定得看看Browserify (我们这里的介绍),它允许您使用Node. Be sure too look into Browserify (our introduction here), which allows you to use Node.
Browserify 也值得去了解一下,不过我个人认为它比Webpack落后很多。Browserify is worth knowing about, but lags far behind Webpack in my opinion. 如果你没有使用webpack,请注意rollup显示的结果明显优于Browserify 导出。 If you aren't using Webpack, note that Rollup shows significantly better results than Browserify exports. BrowserifyBrowserify 由于其简单性,受到了node.js开发人员喜爱。Browserify , because of its simplicity is usually loved by node. js developers.曾经最流行的模块打包器是Browserify ,于2011年发布,它倡导在前端使用node. The most popular module bundler was Browserify , which was released in 2011 and pioneered the usage of node. Js通过browserify 进行编译,并使用babelify使之支持Async函数。 Js using the browserify while using babelify to enable support for asynchronous functions. 如果你没有使用Webpack,那么相比于Browserify 的输出结果,Rollup的输出更好一些。 If you aren't using Webpack, note that Rollup shows significantly better results than Browserify exports. Browserify:Browserify 让你能在浏览器端使用require('modules'),打包所有依赖。Browserify lets you require('modules') in the browser by bundling up all of your dependencies.它是高度模块化的,适用于webpack,Browserify 和Rollup,并支持Flow和TypeScript。 It is highly modular and works well with webpack, Browserify and Rollup, and supports Flow and TypeScript. Browserify 的社区可能只是大,如果它不大的话,就会缺少一些Webpack的潜在必要特性。Browserify 's community is probably just as big, if not larger, but it lacks a few of the potentially essential features that come with webpack. 一旦我们将网速考虑进来,Browserify /Webpack和Rollup/Closure的差异将变得更为显著。 Once we take slow networks into account, the difference between Browserify /Webpack and Rollup/Closure is even more stark. 在1000个模块规模(接近于Reddit1050个模块的规模)时,Browserify 花费的时间比Rollup长大约400毫秒。 In the case of 1000 modules(which is close to Reddit's count of 1050), Browserify takes about 400 milliseconds longer than Rollup. 接下来,只需要安装browserify 、babelify和react-dom,然后衡量未知的成千上万条代码。 And you only had to install browserify , babelify and react-dom, weighing in at some unknown tens of thousands of lines of code. Js有一个不错的社区,因为不仅个人,还有大公司也积极的向开源项目做贡献,就像browserify 和hapi一样。 Js also has a great community as both individuals and big companies are actively contributing to open source projects like Browserify or Hapi. Vue提供官方支持Webpack、Browserify 和SystemJS,而Riot是依靠社区来建立集成系统。 Vue provides official support for webpack and Browserify , while Riot relies on community support for build system integration. 虽然该站点有1050个模块,但是我测量了它们使用Browserify 的实际执行时间后发现比“1000个模块”的测试结果差好多。 Even though they have 1050 modules, I clocked their real-world Browserify execution time as much worse than the“1000 modules” benchmark. 大约一年之前,我在将一个大型JavaScript代码库重构为更小的模块时发现了Browserify 和Webpack中一个令人沮丧的事实:. About a year ago I was refactoring a large JavaScript codebase into smaller modules, when I discovered a depressing fact about Browserify and Webpack:. 对于这个简单的九行模块,我算了一下,Browserify 和Webpack会创建一个压缩后有24.7KB的包(7.6KBmin+gz)。 From this simple 9-line module, I calculated that Browserify and Webpack will create a bundle weighing 24.7KB minified(7.6KB min+gz). 我测试了五种打包方法:Browserify 、带bundle-collapser插件的Browserify、Webpack、Rollup和ClosureCompiler。 I tested five bundling methods: Browserify, Browserify with the bundle-collapser plugin, Webpack, Rollup, and Closure Compiler. 这之后,Browserify 和Webpack会产生更合适的结果:Browserify 最小只有511字段(315min+gz),Webpack则是550字节(297min+gz)。 After this fix, Browserify and Webpack provide much more reasonable bundles: Browserify's is 511 bytes minified(315 min+gz), and Webpack's is 550 bytes minified(297 min+gz).
展示更多例子
结果: 24 ,
时间: 0.0178
English
Bahasa indonesia
日本語
عربى
Български
বাংলা
Český
Dansk
Deutsch
Ελληνικά
Español
Suomi
Français
עִברִית
हिंदी
Hrvatski
Magyar
Italiano
Қазақ
한국어
മലയാളം
मराठी
Bahasa malay
Nederlands
Norsk
Polski
Português
Română
Русский
Slovenský
Slovenski
Српски
Svenska
தமிழ்
తెలుగు
ไทย
Tagalog
Turkce
Українська
اردو
Tiếng việt