在本教程中,我们将讨论部署命令行中的命令行系列。如您所知,在Magento 2中,它们在中添加了许多命令bin/magento
。这可能很难解决,让我解释一下它的更多细节。
部署命令行
命令语法:
php bin/magento setup:static-content:deploy <lang> ... <lang> [--dry-run]
如何运行部署静态内容
php bin/magento setup:static-content:deploy
它将显示如下:
$ php bin/magento setup:static-content:deploy
Requested languages: en_US
=== frontend -> Magento/blank -> en_US ===
........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
默认情况下,它将运行部署默认语言的静态内容: en_EN
如果要部署其他语言的静态内容,例如: pt_BR
跑
php bin/magento setup:static-content:deploy pt_BR
然后得到结果:
Requested languages: pt_BR
=== frontend -> Magento/luma -> pt_BR ===
... progress indicator ...
Successful: 1613 files; errors: 0
=== frontend -> Magento/blank -> pt_BR ===
... progress indicator ...
Successful: 1620 files; errors: 0
=== adminhtml -> Magento/backend -> pt_BR ===
... progress indicator ...
Successful: 1626 files; errors: 0
=== Minify templates ===
... progress indicator ...
Successful: 858 files modified
---