作者:公寓朝仓音梦NQey | 来源:互联网 | 2023-05-19 00:14
Imgoingtostartarichclient-sidewebapplicationwithRubyonRails3.2.IintendedtouseRequ
I'm going to start a rich client-side web application with Ruby on Rails 3.2. I intended to use RequireJS, but it seems to collide with the Asset Pipeline. As far as I know, what the latter basically does is concatenating dependent assets, minifiying and compressing them (correct me if I'm wrong), which does not seem very compatible with loading Javascript files asychronously.
我将使用Ruby on Rails 3.2启动一个富客户端Web应用程序。我打算使用RequireJS,但它似乎与Asset Pipeline发生冲突。据我所知,后者基本上做的是连接依赖资产,迷你加密和压缩它们(如果我错了,请纠正我),这似乎与异步加载Javascript文件非常兼容。
At a first glance, the Asset Pipeline seems to have much better performance. However, RequireJS lets you organize the Javascript code in modules easy to reuse and mange its dependencies.
乍一看,资产管道似乎有更好的表现。但是,RequireJS允许您在模块中组织Javascript代码,以便于重用和管理其依赖项。
Is there any way to combine both of them? In case there isn't, which one would you choose?
有没有办法将两者结合起来?如果没有,你会选择哪一个?
2 个解决方案