在 Liferay 中动态连接 javascript 文件
我看到创建了一个 barebone.jsp 文件(我猜是由 MinifierFilter 创建的)以及用于部署压缩和缓存的 js。我想将开发和生产案例分开,至于开发,我只是不希望 Liferay 不仅缓存生成的 javascript 文件,我根本不想拥有这个生成的实例。
更准确地说,我希望所有 javascript 文件都能动态连接。我总是希望有机会在开发时编辑任何静态文件并尽快看到结果。
实现它的最简单方法是什么?
I see a barebone.jsp file created (I guess by the MinifierFilter) as well as for deploying compressed and cached js. I want to separate development and production cases, and as for development, I just don't want Liferay not only to cache produced javascript file, I don't want to have this generated instance at all.
To be more precise, I want all javascript files to be concatenated on the fly. I always want to have an opportunity to edit any statics files at development and to see results as soon as possible.
What is the easiest way to implement it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将portal-developer.properties 中的设置包含在portal-ext.properties 中。这会禁用缩小器、缓存等,您可以在没有提到的问题的情况下进行开发。不过,您不希望在生产中使用此设置,因为所有文件都将单独加载。
(编辑:建议在答案中包含我在下面的评论):
您可以在 webapps/ROOT/WEB-INF/classes 中找到此文件。
所有 *.fast.load 参数均适用于各种压缩器(css、js),但通常您需要在其中命名的所有参数。
include the settings from portal-developer.properties in your portal-ext.properties. This disables minifiers, caching etc. and you can develop without the problems mentioned. You don't want this setting in production though, as all files will be loaded individually.
(Edit: It might be advisable to include my comment from below in the answer):
You find this file in webapps/ROOT/WEB-INF/classes
All the *.fast.load parameters are for the various minifiers (css, js), but typically you want all of the parameters named in there.