Skip to content

Commit

Permalink
[starter-kits] Fix starter kits so npm run serve isn't `npm run doc…
Browse files Browse the repository at this point in the history
…s:serve` (#2300)

We want to specify no root directory, such that the README.md instructions
make sense. Therefore, by navigating the localhost:8000/dev/index.html
as written, you now get your authored element and a much better experience.

Previously `npm run serve` was serving the docs directory preventing
access to the component.

* Add something on root url, so that folks don't get a 404.

We recommend in the README.md that the user navigates to
/dev/index.html. However you expect `npm run serve` to not
404.

Add a tiny stub document that points users in the right direction.

Co-authored-by: Andrew Jakubowicz <ajakubowicz@google.com>
  • Loading branch information
AndrewJakubowicz and AndrewJakubowicz committed Nov 13, 2021
1 parent 4d522d8 commit 8b9dcb4
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changeset/metal-news-sin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@lit/lit-starter-js': patch
'@lit/lit-starter-ts': patch
---

Fix starter kits so `npm run serve` serves the root directory, and add a link to the `/dev/index.html` component example from `/`.
11 changes: 11 additions & 0 deletions packages/lit-starter-js/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>

<html>
<head>
<meta charset="utf-8" />
<title>Lit Starter Kit</title>
</head>
<body>
<a href="/dev/index.html">Component Demo</a>
</body>
</html>
1 change: 0 additions & 1 deletion packages/lit-starter-js/web-dev-server.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ if (!['dev', 'prod'].includes(mode)) {
export default {
nodeResolve: {exportConditions: mode === 'dev' ? ['development'] : []},
preserveSymlinks: true,
rootDir: 'docs',
plugins: [
legacyPlugin({
polyfills: {
Expand Down
11 changes: 11 additions & 0 deletions packages/lit-starter-ts/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>

<html>
<head>
<meta charset="utf-8" />
<title>Lit Starter Kit</title>
</head>
<body>
<a href="/dev/index.html">Component Demo</a>
</body>
</html>
1 change: 0 additions & 1 deletion packages/lit-starter-ts/web-dev-server.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ if (!['dev', 'prod'].includes(mode)) {
export default {
nodeResolve: {exportConditions: mode === 'dev' ? ['development'] : []},
preserveSymlinks: true,
rootDir: 'docs',
plugins: [
legacyPlugin({
polyfills: {
Expand Down

0 comments on commit 8b9dcb4

Please sign in to comment.