Skip to content

pacx webresources push

github-actions[bot] edited this page Jun 30, 2026 · 5 revisions

Push web resources from a local folder to the target environment

Aliases

pacx wr push

Usage

This command is basically a simple Command Line based replacement for XrmToolbox WebResource Manager

A bit of theory

--- work in progress ---

How to use it

To deploy all the webresources that are in the current folder to the target environment, you can use the following command:

pacx webresources push

The command will:

  • Connect to the target environment
  • Compare the the list of files in the current folder with the list of webresources in the target environment
  • Upload the webresources that are missing in the target environment
  • Update the webresources that are different in the target environment
  • Add the webresources to the solution (if not already added previously)
  • Publish the webresources

If you want to deploy a specific webresource file, you can specify the path to the file:

pacx webresources push --path "C:\path\to\file.js"
pacx webresources push --path "file.js"

If you used pacx wr init to initialize the webresource project, you can use the $ special token to refer to the nearest project root folder, navigating up from the current folder. It will take only the files that are below <project root folder>/<current solution publisher prefix>_.

For example, imagine to have the following project structure:

Webresources/
    new_/
        scripts/
            account.js
        pages/
            home/
                home.css
                home.js
                home.html
    home_react_source/
        src/
            ...
    .wr.pacx

And you are placed under the Webresources/home_react_source/src folder, by typing:

pacx webresources push -p $

It will:

  • Navigate up from the current folder until it comes to the folder containing the .wr.pacx file
  • From there, navigates under the new_ folder (assuming that new is the customization prefix of the current solution publisher)
  • Recourse all the folders under new_, take all the files to deploy them to the target environment

You can also use the $ to target a specific subfolder:

pacx webresources push -p $\scripts

You can also use the * wildcard in the file name to match for files with a specific extension. For example, the following command will deploy all the files with the .js extension from the current folder:

pacx webresources push -p *.js

If you want to deploy the webresources without publishing them, you can use the following command:

pacx webresources push --no-publish
pacx webresources push -np

PLEASE NOTE: by default, all files with *.data.xml extensions are excluded from the upload, because it is assumed that those file may come from a pac solution clone command (or similar).

Push web resource project references

If you have set some webresources as references for the current webresource project (via pacx webresources addReference, you can use the --reference (or -r) option to include them in the deployment. The following example:

pacx webresources push --reference all

Pushes all the webresources in the current folder, plus all the web resources set as references in the current web resource project.

If you want to push only the webresources that are set as references, but not the ones in the current folder, you can use the following command:

pacx webresources push --reference only

If you want to push not all, but just one or more specific webresources set as references, you can use:

pacx webresources push --reference "webresource1_name,webresource2_name"

Where webresourceX_name is the unique name of the webresource once deployed, as set in the --target argument of pacx webresources addReference command.

Arguments

Long Name Short Name Required? Description Default value Valid values
path p N The path to the folder containing the webresources to deploy, or to a specific webresource file to deploy. If not provided, the current folder will be used. - String
no-publish np N Indicates that the webresources should be published after the deployment False true, false
no-action nop N If specified, the command will not perform any action, but it will show what it would do. False true, false
solution s N The name of the solution that will contain the WebResources. If empty, the default solution for the current environment is used as default - String
reference r N Indicates if it should also push the webresources set as project reference. See wiki for additional details. - String
verbose v N If specified, the command will output more details about the operations performed - true, false

Command list

Clone this wiki locally