@mschauer5/spfx-cli
v1.0.12
Published
CLI for SPFx projects
Downloads
683
Readme
CLI for SPFx projects
Install
npm install -g @mschauer5/spfx-cli
Commands
add alias
lf add-alias 'name'
adds a new alias for this program using the name that is provided. ( default is 'lf' )
add-env
lf add-env
adds new .env file to the project setting SITE_URL to pull from your environment variable of 'SPFX_SERVE_TENANT_DOMAIN'. This is required to run serve-fast command.
lf add-env https://contoso.sharepoint.com/sites/dev
Adds a new .env file to the project setting SITE_URL to 'https://contoso.sharepoint.com/sites/dev'. This is required to run serve-fast command.
serve
This requires the spfx-fast-serve package to be installed globally.
lf serve
runs project using spfx-fast-serve and uses the .env file in the project to launch the correct site url.
lf serve https://contoso.sharepoint.com/sites/dev
runs project using spfx-fast-serve and launches the site that is passed in the command and bypasses the .env file in the project.
build
lf build
this command will build the project by runing pnpm|npm run build based on the package manager you are using in the project.
bundle
lf bundle
this command will bundle the project and take the package.json version and update the SharePoint Solution Package version
Open folder of sppkg file location
lf open-solution
this command opens finder|windows explorer of where the solution package is located
Visual Studio Code Commands
requires visual studio code to be installed and having having 'code' in the terminal / command line
lf vs
this command will open the default project in visual studio code
lf vs .
this command will open visual studio code in the current directory
lf vs 'name-of-project'
this command will open visual studio code with the matching project name
lf vs-default project1
this command will set project1 as the default project in visual studio code
lf vs-add project1 /path/to/project1
this command will add project1 to the list of projects in visual studio code
lf vs-delete project1
this command will delete project1 from the list of projects in visual studio code
lf vs-list
this command will list all projects in visual studio code
Version
lf v
this command will list the version of package.json and package-solution.json
lf v-sync
this command will sync the package.json version to package-solution.json version
lf v-increment
this command will increment patch # in package.json and then replace package-solution.json version with updated package.json version
lf v-increment major|minor|patch
this command will increment patch # in package.json and then replace package-solution.json version with updated package.json version based on the argument passed in. Options are major, minor, patch major = 1.0.0 -> 2.0.0 minor = 1.0.0 -> 1.1.0 patch = 1.0.0 -> 1.0.1