<tfoot id='APRge'></tfoot>

  • <legend id='APRge'><style id='APRge'><dir id='APRge'><q id='APRge'></q></dir></style></legend>
        <bdo id='APRge'></bdo><ul id='APRge'></ul>

      <small id='APRge'></small><noframes id='APRge'>

      <i id='APRge'><tr id='APRge'><dt id='APRge'><q id='APRge'><span id='APRge'><b id='APRge'><form id='APRge'><ins id='APRge'></ins><ul id='APRge'></ul><sub id='APRge'></sub></form><legend id='APRge'></legend><bdo id='APRge'><pre id='APRge'><center id='APRge'></center></pre></bdo></b><th id='APRge'></th></span></q></dt></tr></i><div id='APRge'><tfoot id='APRge'></tfoot><dl id='APRge'><fieldset id='APRge'></fieldset></dl></div>

      1. 有人可以解释 Yii 最小化资产应该如何在 Heroku 上工作吗?

        Can someone explain how Yii minimizing assets is supposed to work on Heroku?(有人可以解释 Yii 最小化资产应该如何在 Heroku 上工作吗?)
          <bdo id='njD2P'></bdo><ul id='njD2P'></ul>
        • <i id='njD2P'><tr id='njD2P'><dt id='njD2P'><q id='njD2P'><span id='njD2P'><b id='njD2P'><form id='njD2P'><ins id='njD2P'></ins><ul id='njD2P'></ul><sub id='njD2P'></sub></form><legend id='njD2P'></legend><bdo id='njD2P'><pre id='njD2P'><center id='njD2P'></center></pre></bdo></b><th id='njD2P'></th></span></q></dt></tr></i><div id='njD2P'><tfoot id='njD2P'></tfoot><dl id='njD2P'><fieldset id='njD2P'></fieldset></dl></div>
          <tfoot id='njD2P'></tfoot>
            <legend id='njD2P'><style id='njD2P'><dir id='njD2P'><q id='njD2P'></q></dir></style></legend>

                  <small id='njD2P'></small><noframes id='njD2P'>

                    <tbody id='njD2P'></tbody>
                • 本文介绍了有人可以解释 Yii 最小化资产应该如何在 Heroku 上工作吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我刚刚完成了缩小工作(如何在 Heroku 上为 Yii 应用程序合并和缩小 JS 和 CSS?).但是,它会在 web/assets/ 下创建 all-1bc649be34b1e6afc9b2419687cde016.js 文件.Yii 创建了一个 .gitignore 来忽略该目录中的所有内容.没有任何文件会进入 Heroku.即使我使用 heroku run yii asset assets.php config/assets-prod.php 它也只会创建 web dynos 无法访问的临时文件.(怀疑它在生产中确实失败了.CSS 不在那里!)缩小如何与 Heroku 一起工作?如果我更改文件会怎样?我是否必须再次手动运行 assets 命令?有没有办法让它自动?

                  I just got through getting the minification to work (How do I combine & minify JS and CSS for a Yii app on Heroku?) locally. However, it creates the all-1bc649be34b1e6afc9b2419687cde016.js file under web/assets/. Yii creates a .gitignore to ignore everything in that directory. None of the files will make it to Heroku. Even if I use heroku run yii asset assets.php config/assets-prod.php it will only create ephemeral files that are not accessible to the web dynos. (As suspected it does fail in production. The CSS is not there!) How does minification work with Heroku? What happens if I change a file? Do I have to manually run the assets command again? Is there a way to make it automatic?

                  推荐答案

                  好的,我在 Heroku 文档中找到了这个 gem.https://devcenter.heroku.com/articles/php-support#custom-编译步骤.原来有一种方法可以在 Composer 的 composer.json 中指定一个命令,以便在 slug 编译期间运行.所以我加了

                  Ok I found this gem in Heroku docs. https://devcenter.heroku.com/articles/php-support#custom-compile-step. Turns out there is a way to specify a command in Composer's composer.json to run during the slug compilation. So I added

                  "scripts": {
                      "compile": "php yii asset assets.php config/assets-prod.php"
                  

                  并部署并自动生成缩小的资产!哇!这该死的 ----- 花了大约 10 个小时才开始工作 - 比它应该有的要多得多!

                  and deployed and it generated the minified assets automatically! Whew! This f----- took like 10 hours to get working - way more than it should have!

                  哦,我应该提到我必须破解 config/console.php 也为了让 yii 命令在 Heroku 上运行,因为它给出了关于 Gii 的错误.

                  Oh I should probably mention I had to hack config/console.php also to get the yii command to run on Heroku, because it gives an error about Gii.

                  'bootstrap' => YII_ENV == 'dev' ? ['log', 'gii'] : ['log'],
                  'modules' => YII_ENV == 'dev' ? [
                    'gii' => 'yiigiiModule'
                  ] : [],
                  

                  这篇关于有人可以解释 Yii 最小化资产应该如何在 Heroku 上工作吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Appending GET parameters to URL from lt;formgt; action(将 GET 参数附加到来自 lt;formgt; 的 URL行动)
                  Forcing quot;Save Asquot; dialog via jQuery GET(强制“另存为通过 jQuery GET 对话框)
                  PHP - get certain word from string(PHP - 从字符串中获取某个单词)
                  How to debug a get request in php using curl(如何使用 curl 在 php 中调试 get 请求)
                  get a # from a url in php(从 php 中的 url 获取 #)
                  PHP - include() file not working when variables are put in url?(PHP - 将变量放入 url 时,include() 文件不起作用?)
                    • <bdo id='uPrYo'></bdo><ul id='uPrYo'></ul>

                        <tbody id='uPrYo'></tbody>

                        1. <tfoot id='uPrYo'></tfoot><legend id='uPrYo'><style id='uPrYo'><dir id='uPrYo'><q id='uPrYo'></q></dir></style></legend>

                          <i id='uPrYo'><tr id='uPrYo'><dt id='uPrYo'><q id='uPrYo'><span id='uPrYo'><b id='uPrYo'><form id='uPrYo'><ins id='uPrYo'></ins><ul id='uPrYo'></ul><sub id='uPrYo'></sub></form><legend id='uPrYo'></legend><bdo id='uPrYo'><pre id='uPrYo'><center id='uPrYo'></center></pre></bdo></b><th id='uPrYo'></th></span></q></dt></tr></i><div id='uPrYo'><tfoot id='uPrYo'></tfoot><dl id='uPrYo'><fieldset id='uPrYo'></fieldset></dl></div>

                            <small id='uPrYo'></small><noframes id='uPrYo'>