如何为浏览器编译 javascript 库?

How can I compile a javascript library for the browser?

我想使用一个库(handlebars-helpers) in the browser. I tried following the instructions,但是嘿,好像行不通。

最重要的是,虽然我想知道我在做什么,而不仅仅是复制粘贴,还因为当我尝试使用 handlebars-intl.[=13= 时,同样的问题可能会再次出现]

我应该 google 做什么,才能在此处找到有关幕后操作的基本教程?它浏览器化了吗?

我想你可以使用 hbsfy。

它将 Handlebars 模板编译为纯文本 Javascript。编译后的模板只有一份 Handlebars 运行时副本,因此它们轻巧且速度快!

请查看 https://www.npmjs.com/package/hbsfy 了解更多详情。