Manage External Dependencies
Last updated
Last updated
OXIDE comes with built-in package management for external dependencies. Node.js packages can be added as dependencies and used within views (TS apps only), within App packages (TS apps only), and within CloudCode.
Dependencies can be managed in two ways:
They can be added using OXIDE's UI
They can be added and edited by updating package.json
directly
The easiest way to add a Node.js package to your app is by firing the Add Node.js package action from the command palette.
OXIDE will then prompt you to select your target for the dependency:
Select the global "App package" to add a dependency that needs to be imported from your app's views (TS apps only)
Or select the specific app package (TS apps only) or CloudCode task
Within CloudCode tasks and App packages, OXIDE also presents a dependencies node which can be right-clicked to add a Node.js package directly.
After selecting the target, OXIDE will prompt you with an NPM search box:
From here you can search for any NPM package and selecting one will start the process of adding it to the target and updating its corresponding yarn.lock
file in the background. OXIDE will confirm when yarn.lock
has been updated successfully. After that point, you can start using the dependency.
If you are more experienced with the Node.js ecosystem, you can edit the package.json
file directly.
Prerequisite: Make sure you have the Show configuration files setting enabled.
Navigate to and open the package.json
file as follows:
App-level package.json
(TS apps only): Expand to the Other section in the App Tree panel. By default, this panel is included in OXIDE's Overview workspace.
App package (TS apps only) or CloudCode task: Expand the file tree for an app package or CloudCode task:
Tip: These files can also be found by using the Open file action.
Once the package.json
file is open, locate the dependencies section. If the section does not exist, it will be available via autocomplete:
Make the necessary edits and then run the Update yarn.lock action by right-clicking on the app package or CloudCode task, or by firing this action directly from the command palette.