Installing dependencies
Learn how to extend the functionality of Latitude projects installing any npm dependency
Introduction
You might want to extend the functionality of your Latitude projects by using other npm packages.
Here’s how you can do it:
Install dependencies
You can install npm dependencies with a regular npm install command from the root of your project. Example:
This will create a package.json file in your project root and add the dependency to it. The Latitude CLI will keep track of the dependencies you install and bundle them with your project.
Use your dependencies
Latitude views are a superset of Svelte’s template syntax. So you can use any JS dependency like you would in a Svelte component. Following our example:
Check out the examples section to see some use cases using third-party npm dependencies in Latitude projects.