Pylons webhelpers 缩小文件名太长

发布于 2024-11-15 23:05:46 字数 230 浏览 5 评论 0原文

我正在使用 pylons“minify”webhelper 来缩小并组合我的所有 javascript/css 文件。助手似乎连接了所有文件名并使用结果作为组合版本的名称。我有很多正在组合的 JavaScript 文件,生成的文件名给出了错误:

IOError: [Errno 63] File name too long

有没有办法手动指定文件名或缩短它而不更改帮助程序代码?

I'm using the pylons "minify" webhelper to minify and combine all of my javascript/css files. It seems the helper concatenates all of the file names and uses the result as the name for the combined version. I have a lot of JavaScript files that are being combined and the resulting file name is giving the error:

IOError: [Errno 63] File name too long

Is there any way to manually specify the file name or shorten it without changing the helper code?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

泅人 2024-11-22 23:05:46

基本上,MinificationWebHelpers 向 WebHelpers javascript_link 和 stylesheet_link 函数添加以下选项:

  • minified (bool):尽可能缩小/减少传递到其最小大小的每个文件,以减少页面加载时间。
  • 组合(bool):将传递的所有文件合并到一个文件中以减少服务器请求,从而减少页面加载时间。
  • beaker_kwargs (dict):覆盖将传递给 beaker_cache 的默认参数。
  • 组合文件名(字符串):将与组合= True结合使用的文件名的名称

所以看起来您可以将组合文件名设置为您想要的名称

Basicaly MinificationWebHelpers adds following options to the WebHelpers javascript_link and stylesheet_link functions:

  • minified (bool): Minifies/reduces as much as possible each of the files passed to it’s minimum size to reduce page load times.
  • combined (bool): Joins all files passed into a single one to reduce server requests which in turn reduces page load times.
  • beaker_kwargs (dict): override default arguments that will be passed to beaker_cache.
  • combined_filename (string): Name of the filename that will be used in conjunction with combined=True

So it looks like you can set combined_filename to whatever you want the name to be

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文