Skip to content

init

Terminal window
nx g @geekvetica/nx-astro:init

Run it once per workspace, after installing the plugin. It:

  • adds @geekvetica/nx-astro with the default target names to plugins in nx.json, unless it is already there,
  • adds astro to the development dependencies of the root package.json, unless it is already there,
  • adds the @astrojs/node adapter that fits that Astro version, unless it is already there,
  • formats the changed files and installs the added packages.

Running it again changes nothing that already exists.

Option Type Default Description
skipPackageJson boolean false Registers the plugin only; package.json is not changed and nothing is installed.
astroVersion string latest Major Astro version to install: 5, 6, 7 or latest, which is 7. Ignored when the workspace already has Astro.

Install Astro 6 instead of the latest major:

Terminal window
nx g @geekvetica/nx-astro:init --astroVersion=6
nx-astro 3.2.0 · MIT Developed by