Skip to content

Commit

Permalink
fix(ts): add incremental compilation to tsconfig.json
Browse files Browse the repository at this point in the history
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".
  • Loading branch information
vikerman committed Mar 12, 2021
1 parent 77f14a7 commit c4e2010
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/generators/app-lit-element-ts/templates/MyApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class <%= className %> extends LitElement {
<div class="logo">${openWcLogo}</div>
<h1>${this.title}</h1>
<p>Edit <code>src/<%= className %>.js</code> and save to reload.</p>
<p>Edit <code>src/<%= className %>.ts</code> and save to reload.</p>
<a
class="app-link"
href="https://open-wc.org/guides/developing-components/code-examples"
Expand Down
5 changes: 3 additions & 2 deletions src/generators/app-lit-element-ts/templates/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"compilerOptions": {
"target": "es2018",
"module": "esnext",
Expand All @@ -13,7 +13,8 @@
"outDir": "out-tsc",
"sourceMap": true,
"inlineSources": true,
"rootDir": "./"
"rootDir": "./",
"incremental": true
},
"include": ["**/*.ts"]
}
5 changes: 3 additions & 2 deletions src/generators/wc-lit-element-ts/templates/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"compilerOptions": {
"target": "es2018",
"module": "esnext",
Expand All @@ -14,7 +14,8 @@
"sourceMap": true,
"inlineSources": true,
"rootDir": "./",
"declaration": true
"declaration": true,
"incremental": true
},
"include": ["**/*.ts"]
}

0 comments on commit c4e2010

Please sign in to comment.