Installing astro-vtbot
astro-vtbot
can be installed as a full Astro integration or as a node package. Both ways install the package as a dependency in your project and allow you to import its components and scripts in your own pages. Installing the package as an Astro integration in addition sets up your project with an automatic loading indicator and automatic linter warnings in the browser console. Installing as an integration also gives you access to The Bag’s DevToolbar App!
Contents
Installing as an Astro integration
Installing astro-vtbot
as an Astro integration will install the package and in addition it will by default add vtbot
’s <LoadingIndicator />
component and <Linter />
component to all pages that use Astro’s <ViewTransitions />
. However, there are also options to selectively opt out of either feature, as detailed below.
To install astro-vtbot
as an Astro integration, run the astro add
command in your project directory …
… and press the return key twice to answer the questions with “yes”:
As a result astro-vtbot
will hook into your astro.config
file:
When you start Astro in DEV mode, e.g. npm run dev
, this will automatically add vtbot
’s <Linter />
component to all pages that use Astro’s <ViewTransitions />
. This will only happen in DEV mode. When you build for production, the <Linter />
component will not be included.
You can disable automatic linting and the loading-indicator without having to remove the integration by setting the loadingIndicator
option and/or the autoLint
option of vtbot
in your astro.config
file to false
(the default is true
):
After disabling the loadingIndicator, as an alternative, you could also add the <ProgressBar />
component to your Layout.astro.
If you have Astro’s DevToolbar enabled, The Bag will show up as a new app there and will give you access to the InspectionChamber on every page without any further modification of your project.
Installing as a node package
To install astro-vtbot
as a node package without the integration, run the following command in your project directory: