Skip to content

@lwc-garden/utils

This package may be used standalone and is not dependant on the @lwc-garden/core package. You can run a simple npx lwr dev site and still take advantage of the following utilities and configuration.

Want to skip the docs and jump straight to a live example? Check it out here.

Installation

Terminal window
pnpm add -D @lwc-garden/utils

Edit your lwr.config.json file to add the @lwc-garden/utils package to the "modules" config:

lwr.config.json
{
"lwc": {
"modules": [
{
"dir": "./.garden/components",
"namespace": "garden"
},
{
"npm": "@lwc-garden/utils",
},
{
"dir": "./force-app/main/default/lwc",
"namespace": "c"
}
]
},
"moduleProviders": [
"@lwrjs/label-module-provider",
"@lwrjs/app-service/moduleProvider",
"@lukethacoder/lwrjs-lwc-module-provider",
"@lwrjs/npm-module-provider"
],
"routes": [
{
"id": "app",
"path": "/",
"rootComponent": "garden/app",
"layoutTemplate": "./.garden/layouts/index.html",
"bootstrap": {
"syntheticShadow": true
}
}
]
}