This does not work yet, due to lit-element's bare import of lit-html:
TypeError: Error resolving module specifier: lit-html
--- /dev/null
+node_modules
+package-lock.json
--- /dev/null
+import { LitElement, html, css } from './node_modules/lit-element/lit-element.js';
+
+class HelloWorld extends LitElement {
+ render() {
+ return html`<p>Hello world! Came here from ${document.referrer || 'unset-referrer' }</p>`;
+ }
+}
+
+customElements.define('hello-world', HelloWorld);
--- /dev/null
+<head>
+ <title>lit-html npm example</title>
+ <meta charset="utf-8">
+ <script type="module" src="./hello-world.js"></script>
+</head>
+
+<body>
+
+<h1>Hello world with lit-html from npm</h1>
+
+<p>If you don't see hello world below, you need to run <code>npm install</code>.</p>
+
+<hello-world></hello-world>
+</body>
+
--- /dev/null
+{
+ "name": "webcomponents-npm-test",
+ "version": "0.0.1",
+ "private": "true",
+ "description": "test",
+ "main": "index.js",
+ "dependencies": {
+ "lit-element": "^2.2.1"
+ },
+ "devDependencies": {},
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1",
+ "run": "python -m http.server -b localhost"
+ },
+ "author": "",
+ "license": "ISC"
+}