Skip to content

Commit 25f4760

Browse files
committed
Update demo to test loading lit-html works correctly,
and that relative paths within the original example work correctly. You probably don't want to commit this to the repository, or maybe want to commit it as another demo/test. Also, note that I couldn't support a path for lit-html of 'lit-html': '../node_modules/lit-html/lit-html' because then there's no way to specify the path to lit-html's support files (i.e. the other files in the lit-html/ directory). So instead I did: 'lit-html': '../node_modules/lit-html'
1 parent f5c7fef commit 25f4760

File tree

6 files changed

+16
-3
lines changed

6 files changed

+16
-3
lines changed

demo/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
paths: {
1414
es6: '../es6',
1515
babel: '../node_modules/@babel/standalone/babel.min',
16+
'lit-html': '../node_modules/lit-html',
1617
'babel-plugin-module-resolver': '../node_modules/babel-plugin-module-resolver-standalone/index'
1718
}
1819
});

demo/src/class.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import sum from 'src/sum';
2-
3-
console.log( sum(1,2) );
1+
import sum from './sub/sum';
2+
import {html, render} from 'lit-html/lit-html';
43

54
class A {
65
constructor(a) {
@@ -9,3 +8,6 @@ class A {
98
}
109

1110
new A('world!');
11+
12+
var h = "Hello", w = "world";
13+
render(html`${h} ${w}, 1 + 2 = ${sum(1,2)}!`, document.body);

demo/src/sub/sum.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import sum from './sum2';
2+
export default (a, b) => sum(a, b);
File renamed without changes.

package-lock.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,8 @@
2626
"@babel/standalone": "7.4.2",
2727
"babel-plugin-module-resolver-standalone": "0.0.1",
2828
"requirejs": "^2.3.6"
29+
},
30+
"dependencies": {
31+
"lit-html": "^1.1.2"
2932
}
3033
}

0 commit comments

Comments
 (0)