sfdx-ngx-plugin
SFDX plugin for Angular apps deployment on Salesforce
⚠️ This package is yet in beta version and may not work in all cases.
Please, create an issue if you encountered any issues
Prerequesites
Installation
Install as plugin
sfdx plugins:install sfdx-ngx-plugin
Install from source
- Clone repository
git@github.com:rzhigalov/sfdx-ngx-plugin.git
- Open cloned folder
cd path/to/cloned/repo
- Install npm modules
npm install
oryarn install
- Link the plugin
sfdx plugins:link .
Usage
General flow
-
Setup SFDX project e.g.
sfdx force:project:create -n ProjectName --template standard
) -
Create scratch org or configure persistent instance
-
Initialize Angular project
e.g.ng new my-shiny-metal-project
/*** ⚠️ If you use routing in Angular app, than configure it to use URL fragment strategy* This is required as you can't override Salesforce routing resolution*/RouterModule; -
Run
sfdx ngx:init
and follow the prompts -
(optional) Configure
vf.template.page
with controller and Visualforce page appearance -
Run
sfdx ngx:build
-
Deploy code to Salesforce (
sfdx force:source:deploy
orsfdx force:source:push
)
Commands
sfdx ngx:init`
Initializes files and settings for plugin
USAGE $ sfdx ngx:init [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL] OPTIONS --json format output as json --loglevel= [default: warn] logging level
sfdx ngx:build
Builds Angular project and packs for SFDC deployment
USAGE $ sfdx ngx:build [-b <string>] [-m npm|yarn|pnpm] [-p <directory>] [--ngproject <directory>] [-t <directory>] [--sfdcpage <string>] [--sfdcresource <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL] OPTIONS -b, --buildcmd=buildcmd Angular build command -m, --packagemanager= Used package manager -p, --ngpath=ngpath Relative path to Angular project -t, --sfdcpath=sfdcpath Relative path to SFDC target dir --apiversion=apiversion SFDC API version --ngproject=ngproject Angular Project name --sfdcpage=sfdcpage SFDC Static Visualforce page name --sfdcresource=sfdcresource SFDC Static Resource name --json format output as json --loglevel= [default: warn] logging level