Install third-party npm packages
Describes how to install third-party npm packages in Spire.
Configured Commerce lets partners and clients install third-party npm packages within Spire.
- Go to
src/FrontEnd/modules/blueprints/{BlueprintThatNeedsCustomPackage}
. - Use
npm install --save {PackageName}
to install all the package(s) needed for development. This adds or updates a file atsrc/FrontEnd/modules/blueprints/{BlueprintThatNeedsCustomPackage}/package.json
.Important
The installation of third-party npm packages only works under the blueprint folder. Installing the packages under
src/FrontEnd
(which is the root folder of Spire) may cause build failure. - Push the changes to sandbox branch.Â
- Optimizely uses the Workspaces feature of npm to link the blueprint packages and the Spire package. More details can be found here: https://docs.npmjs.com/cli/v7/using-npm/workspaces.
- Each Workspace is one blueprint folder under
src/FrontEnd/modules/blueprints
. A Powershell script runs during build time to generate workspaces in the package.json of the Spire root automatically.
Note
As of June 27, 2024, Optimizely no longer checks the licenses for third-party packages included in partner or customer builds, leaving you responsible for any licensing. If you have questions about what license types you should use, check with your company's compliance or legal departments.
Updated 5 months ago