Skip to content

Commit c4e2010

Browse files
committed
fix(ts): add incremental compilation to tsconfig.json
This fixes open-wc/open-wc#2113 - initial double reload and flicker in dev mode. Should also make the subsequent recompiles faster also (though not measured it). Also fixed the text in the app to say ".ts" instead of ".js".
1 parent 77f14a7 commit c4e2010

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/generators/app-lit-element-ts/templates/MyApp.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export class <%= className %> extends LitElement {
5353
<div class="logo">${openWcLogo}</div>
5454
<h1>${this.title}</h1>
5555
56-
<p>Edit <code>src/<%= className %>.js</code> and save to reload.</p>
56+
<p>Edit <code>src/<%= className %>.ts</code> and save to reload.</p>
5757
<a
5858
class="app-link"
5959
href="https://open-wc.org/guides/developing-components/code-examples"

src/generators/app-lit-element-ts/templates/tsconfig.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{
1+
{
22
"compilerOptions": {
33
"target": "es2018",
44
"module": "esnext",
@@ -13,7 +13,8 @@
1313
"outDir": "out-tsc",
1414
"sourceMap": true,
1515
"inlineSources": true,
16-
"rootDir": "./"
16+
"rootDir": "./",
17+
"incremental": true
1718
},
1819
"include": ["**/*.ts"]
1920
}

src/generators/wc-lit-element-ts/templates/tsconfig.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{
1+
{
22
"compilerOptions": {
33
"target": "es2018",
44
"module": "esnext",
@@ -14,7 +14,8 @@
1414
"sourceMap": true,
1515
"inlineSources": true,
1616
"rootDir": "./",
17-
"declaration": true
17+
"declaration": true,
18+
"incremental": true
1819
},
1920
"include": ["**/*.ts"]
2021
}

0 commit comments

Comments
 (0)