The SXA CLI watch, build, re-build, and upload tasks
SXA lets developers build assets and upload them either locally using SXA CLI or with CI servers. This topic describes the tasks to watch, build, rebuild, and upload files.
Build tasks
To build and upload theme assets, use the following task:
sxa build [taskName]
alias:
sxa b
Possible addition:
-
d, --debug
- to provide additional debugging information.
The following table describes the global build tasks:
Global task |
Description |
---|---|
|
Compiles Sass into CSS from the root of the |
|
Compiles the following files to
|
|
Bundles and minifies the files in the |
|
Runs |
|
Bundles and minifies JavaScript files in the |
|
Compiles sass components into CSS and bundles and minifies CSS files. |
|
Creates sprite for flags. |
Rebuild tasks
To rebuild and upload theme assets, use the following task:
sxa rebuild [taskName]
alias:
sxa r
Possible additions:
-
-p, --password
- to enter a password for uploading. -
-l, --login
- to log in for uploading. -
-d, --debug
- to provide additional debugging information. -
-u, --url
- instance URL for uploadingNoteIf you provide a URL this way, this URL is used even if you have configured something else for a local or global server URL strategy.
The following table describes the global rebuild tasks:
Task |
Description |
---|---|
rebuild All |
Compiles Sass components into CSS, minifies JavaScript and CSS, uploads JavaScript, CSS, and images. |
rebuild Main |
Compiles Sass components into CSS, minifies JavaScript and CSS, uploads JavaScript, and CSS. |
Upload tasks
To upload the theme assets based on the theme configuration, use the following task:
sxa upload [taskName]
alias:
sxa u
Possible additions:
-
-p, --password
- to enter a password for uploading. -
-l, --login
- to log in for uploading. -
-d, --debug
- to provide additional debugging information. -
-u, --url
- instance URL for uploading.NoteIf you provide a URL this way, this URL is used even if you have configured something else for local a local or global server URL strategy.
The following table describes the global upload tasks:
Task |
Description |
---|---|
|
Uploads JavaScript, CSS, and images to the Sitecore instance. |
|
Uploads CSS files from the styles folder based on the theme configuration. |
|
Uploads JavaScript files from the scripts folder based on the theme configuration. |
|
Uploads files from the images folder to the Sitecore instance. For Sass and CSS. |
|
Uploads |
|
Uploads files from the fonts folder to the Sitecore instance. |
Watch tasks
To watch theme asset changes and upload the modified files automatically, use the following task:
sxa watch [taskName]
alias:
sxa w
Possible additions:
-
-p, --password
- to enter a password for uploading. -
-l, --login
- to log in for uploading. -
-d, --debug
- to provide additional debugging information. -
-u, --url
- instance URL for uploadingNoteIf you provide a URL this way, this URL is used even if you have configured something else for local a local or global server URL strategy.
The following table describes the global watch tasks:
Task |
Description |
---|---|
|
Aggregates the functionality of the following tasks: |
|
Runs a list of tasks: |
|
Monitors changes and compiles all changes to
|
|
Monitors changes and compiles components and styles in the following folders:
|
|
Monitors changes in component styles in the sass folder and compiles them to the styles folder. |
|
Monitors changes in |
|
Monitors changes in the |
|
Monitors changes of CSS files in the |
|
Monitors changes of JavaScript files in the |
|
Monitors changes of JavaScript files in the |
|
Monitors changes of HTML files and uploads them to the server to be parsed by Creative Exchange. |
|
Monitors changes of Scriban files and uploads them to the server. |
|
Monitors changes in the |