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

  1. Open Project Settings (under the Project menu)
  2. Click the button next to Build & Run in the sidebar
  3. Choose Run Script
  4. Enable both the Build and Run actions
  5. 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.

gif of Nova executing a run task

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

最終更新日: 2020年09月16日