Dependency management

Initialize package.json

Running the airplane views init command will search for a file named package.json in your current directory and in parent directories.
  • If found in your current directory, the Airplane CLI will add required dependencies to this package.json and use it to manage dependencies moving forward.
  • If found in a parent directory, you will be asked if you want to use it to manage view dependencies or if you want us to create a new package.json for you.
  • If package.json is not found, we will initialize a default package.json for you in your current directory.
When you deploy your view, the closest directory containing a package.json will become the root, the directory which is uploaded during the deployment.

Install additional dependencies

To install additional dependencies, you can add them to your package.json via npm or yarn like you normally would:
# Example installing the airplane SDK
# Updates package-lock.json
npm install airplane
See Using a 3rd party component for an example of using a 3rd party component in a view.