Incorporating Tasks
Speaking of making development smoother, let’s use Nova’s Run Tasks feature to give ourselves lightning-fast access to our new build
and watch
scripts.
Creating a Task
- Open Project Settings (under the Project menu)
- Click the button next to Build & Run in the sidebar
- Choose Run Script
- Enable both the Build and Run actions
- Paste the following snippet into the Script box:
if [ $NOVA_TASK_NAME == "build" ]; then
npm run build
fi
if [ $NOVA_TASK_NAME == "run" ]; then
npm run watch
fi
Now we’re just a click away from building our extension script or spinning up a watcher.
Or press Command-B
and Command-R
if you prefer a keyboard shortcut.
That’s all for this guide! As you dig in and start building extensions for Nova, we’d love to hear what you’re working on and any thoughts you might have about how to improve the experience.
- Previously…
- ⬅️ Part 3: Bundling Dependencies