How to exploit all commands in Magento 2 CLI (Part 10)

In this Article we going to discuss about the Magento 2 Command line (CLI)

Part 10: Deploy static view files

Everyone knows Magento 2 has a powerful command-line interface tools (CLI). It permits you to complete task including installation, configuration, database backups, compiling LESS etc. Here I will show you how to modernize deployment config using command-line in Magento 2. Before starting this guide please,refer our previous guidelines:

Static view files

There are the files in the presentation layer of Magento 2. They cached at

[magento _folder]/pub/static

Static view files deployment is affected by a Magento by the following modes:

Developer mode: Magento creates them on demand, but the rest are stored in a file for speed of access.

Default and production mode: Static view files are not generated or stored.

 Deploy static view files

The following command used to deploy static view files in Magento:

php bin/magento setup:static-content:deploy <lang> … <lang> [–dry-run]

The parameters are explained in the following tabulation

ParameterDescriptionRequired
langLanguage codes for which to output static view files. You can get the list by running magento

Info:language:list

no
-dry-runAnalyze the following output by toolsno
  • Deploy Static files for en_US
php bin/magento setup:static-content:deploy en_US
  • After run the above command you will get the following message
Requested languages: en_US

 === frontend -> Magento/luma -> en_US ===

 … progress indicator …

 Successful: 1613 files; errors: 0 === frontend -> Magento/blank -> en_US ===

… progress indicator …

 Successful: 1620 files; errors: 0 === adminhtml -> Magento/backend -> en_US ===

 … progress indicator …

 Successful: 1626 files; errors: 0 === Minify templates ===

… progress indicator …

Successful: 858 files modified

 —

New version of deployed files: 1430774973 

I hope the following guidelines will help you to deploy static view files using command line in Magento 2 CLI(Part 10)


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *