Skip to content

lit/lit.dev

Repository files navigation

lit.dev

New site, new repo.

Packages

This is a Lerna monorepo.

  • lit-dev-content: Main content of lit.dev
  • lit-dev-server: Production web server for lit.dev
  • lit-dev-tools: Eleventy plugins and other internal tools

Developing

Install dependencies

npm i && npm run bootstrap

Build all

npm run build

Develop site content

npm run dev

Serves at http://localhost:8000 (port may be incremented if not available, see console output).

You may also prefer to run each dev script in its own terminal:

cd packages/lit-dev-content

npm run build:ts:watch       # TypeScript
npm run dev:build:site:watch # Eleventy
npm run dev:serve            # @web/dev-server

Dev mode is different to production in these ways:

  • Browser auto-reload.
  • CSS is not inlined or minified. CSS changes are reflected immediately.
  • JS is not inlined, bundled, bare-module transformed, or minified. JS changes are reflected immediately after tsc compile.
  • HTML is not minified.

If needed, you can check for dev mode from an Eleventy template using the dev global:

{% if dev %}
  <p>Dev mode</p>
{% else %}
  <p>Prod mode</p>
{% endif %}

Update generated API docs

First run npm run dev as shown above, and then in another terminal:

cd packages/lit-dev-tools
npm run build:api:watch

You can now edit the comments in any .ts file in the lit-monorepo-submodule directory, and after the automatic rebuild, the dev site will refresh.

code packages/lit-dev-tools/lit-monorepo-submodule/

The lit-monorepo-submodule directory is a Git submodule, so you can make changes directly here, and push PRs from it as normal.

The submodule is configured to track the lit-next branch, but Git submodules are always pinned to a particular commit. To update the current commit, run:

cd packages/lit-dev-tools
npm run submodule:pull

Serve production mode

npm run build
npm start

Watch production mode

npm start # production server

cd packages/lit-dev-content
npm run build:ts:watch     # TypeScript
npm run build:rollup:watch # Rollup
npm run build:site:watch   # Eleventy

Serves at http://localhost:8080

Start production Docker environment locally

docker build -t litdev .
docker run --rm --name litdev -p 8080:8080 litdev

About

The Lit website

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 107