Magento 2 Deploy Static Content
In this tutorial, we will talk about Deploy Static Content setup:static-content:deploy
in Command Line Series. As you know, from Magento 2, they add many commands in bin/magento
. This may difficult to get approach this, let me explain more detail about Deploy Static Content.
Deploy Static Content via command line
Go to Magento admin root folder and show usages:
php bin/magento setup:static-content:deploy -h
Output:
Usage:
setup:static-content:deploy [options] [--] [<languages>]...
Arguments:
languages Space-separated list of ISO-636 language codes for which to output static view files.
Options:
-f, --force Deploy files in any mode.
-s, --strategy[=STRATEGY] Deploy files using specified strategy. [default: "quick"]
-a, --area[=AREA] Generate files only for the specified areas. [default: ["all"]] (multiple values allowed)
--exclude-area[=EXCLUDE-AREA] Do not generate files for the specified areas. [default: ["none"]] (multiple values allowed)
-t, --theme[=THEME] Generate static view files for only the specified themes. [default: ["all"]] (multiple values allowed)
--exclude-theme[=EXCLUDE-THEME] Do not generate files for the specified themes. [default: ["none"]] (multiple values allowed)
-l, --language[=LANGUAGE] Generate files only for the specified languages. [default: ["all"]] (multiple values allowed)
--exclude-language[=EXCLUDE-LANGUAGE] Do not generate files for the specified languages. [default: ["none"]] (multiple values allowed)
-j, --jobs[=JOBS] Enable parallel processing using the specified number of jobs. [default: 0]
--symlink-locale Create symlinks for the files of those locales, which are passed for deployment, but have no customizations.
--content-version=CONTENT-VERSION Custom version of static content can be used if running deployment on multiple nodes to ensure that static content version is identical and caching works properly.
--refresh-content-version-only Refreshing the version of static content only can be used to refresh static content in browser cache and CDN cache.
--no-javascript Do not deploy JavaScript files.
--no-css Do not deploy CSS files.
--no-less Do not deploy LESS files.
--no-images Do not deploy images.
--no-fonts Do not deploy font files.
--no-html Do not deploy HTML files.
--no-misc Do not deploy files of other types (.md, .jbf, .csv, etc.).
--no-html-minify Do not minify HTML files.
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
Help:
Deploys static view files
Syntax
Simple run the following command line to deploy static content your store when install / update an extension
php bin/magento setup:static-content:deploy
Enjoyed the tutorial? Spread it to your friends!
magento-2-module-development
command
line
cli
console
indexer
reindex

Sam Thomas
CEO and Founder of Mageplaza. Pursueing a simple and healthy lifestyle. A friend, a husband and a dad of two children, a trainer and an influencer wannabe. He is a big fan of sports and travel, also.
Featured Extensions

One Step Checkout
$199
192 reviews

Layered Navigation
$99
92 reviews

Automatic Related Products
$199
31 reviews

PDF Invoice
$199
25 reviews

Affiliate
$99
28 reviews

Reward Points
$99
22 reviews

CRO
$645

Product Feed
$149
35 reviews