The Hello World recipe contains the minimum code needed to get up and running with a single page LWR app.
The recipe's directory structure looks like this:
scripts/
└── start-server.mjs // create and start server
src/
├── assets/ // static assets
│ └── logo.png
└── modules/ // lwc modules
└── example/
└── app/
├── app.css
├── app.html
└── app.js
lwr.config.json // lwr configuration
package.json // npm packaging configuration
The LWR server is configured in lwr.config.json
, at the root of the project. The Hello World recipe has one LWC module and one route.
// lwr.config.json
{
"lwc": { "modules": [{ "dir": "$rootDir/src/modules" }] },
"routes": [
{
"id": "example",
"path": "/",
"rootComponent": "example/app"
}
]
}
Learn more in Configure a LWR Project.
# from the lwr-recipes root
yarn install
yarn build
cd packages/hello-world
yarn start # dev mode and ESM format
Open the site at http://localhost:3000
See documentation for all commands here.