Building the Solution
npm run [command]
The following commands are available
- all
- Runs all scripts
- build
- Creates the
dist/[project].js
solution file
- Creates the
- prod
- Creates the
dist/[project].min.js
solution file
- Creates the
- spfx
- Creates the
dist/[project].sppkg
solution file
- Creates the
Classic Solution
- Access the target web to deploy the solution to
- Access the
Site Assets
library - Create a folder to match the
project
name - Upload the following files to the folder
assets/index.html
dist/[project].min.js
- Access the
Site Pages
library - Select
New
and click theWeb Part Page
option- Set the name
- Select
Full Page
template - Select
Site Assets
for the target location
- Move the page to the target solution folder
- Edit the page
- Click the target zone to add the WebPart to
- Select
Content Editor
from theMedia and More
group - Set the relative url to the index.html file
- Set the border to
none
- Save the page
Modern Solution
- Access the tenant or site collection app catalog
- Upload the
dist/[project].sppkg
file to the app catalog- Check-In the file if necessary
- Deploy the solution
- Access the target web to deploy the solution to
- Access the
Site Contents
- Click
Add -> App
- Select the
[Solution]
app - Create or access a modern page
- Edit the page
- Add the webpart to the target location
- Save and publish the page
SharePoint Assets (Optional)
Creating the Assets
- Access the page containing the solution
- Access the developer tool’s console a) Press F-12 or Ctrl+Shift+I b) Select the console tab
- Install the Solution
GlobalVariableName.Configuration.install()
Removing the Assets
- Access the page containing the solution
- Access the developer tool’s console a) Press F-12 or Ctrl+Shift+I b) Select the console tab
- Install the Solution
GlobalVariableName.Configuration.uninstall()