Skip to content

Commit 1ca19af

Browse files
committed
Merge branch 'master' into wjh/web-test-runner
2 parents e2b6aa1 + d867684 commit 1ca19af

File tree

5 files changed

+25
-0
lines changed

5 files changed

+25
-0
lines changed

packages/lwc/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,8 @@
7676
"./synthetic-shadow": "./synthetic-shadow.js",
7777
"./template-compiler": "./template-compiler.js",
7878
"./wire-service": "./wire-service.js"
79+
},
80+
"volta": {
81+
"extends": "../../package.json"
7982
}
8083
}

playground/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ $ npm run dev # Get app server running
77
$ npm run build # Build app in production mode
88
$ npx serve # Serve the app (after running `npm run build`).
99
```
10+
11+
## TypeScript
12+
13+
To enable TypeScript in the LWC playground, add `@rollup/plugin-typescript` to the list of plugins in `rollup.config.js`. The playground has a pre-configured `tsconfig.json` that allows both JS and TS files to be used.

playground/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"devDependencies": {
1212
"@lwc/rollup-plugin": "8.20.0",
1313
"@rollup/plugin-replace": "^6.0.2",
14+
"@rollup/plugin-typescript": "^12.1.2",
1415
"lwc": "8.20.0",
1516
"rollup": "^4.40.0",
1617
"rollup-plugin-livereload": "^2.0.5",
@@ -24,5 +25,8 @@
2425
]
2526
}
2627
}
28+
},
29+
"volta": {
30+
"extends": "../package.json"
2731
}
2832
}

playground/rollup.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import lwc from '@lwc/rollup-plugin';
22
import replace from '@rollup/plugin-replace';
33
import serve from 'rollup-plugin-serve';
44
import livereload from 'rollup-plugin-livereload';
5+
// import typescript from '@rollup/plugin-typescript'; // Only required for TypeScript projects
56

67
const __ENV__ = process.env.NODE_ENV ?? 'development';
78

@@ -15,6 +16,7 @@ export default (args) => {
1516
},
1617

1718
plugins: [
19+
// typescript(), // Only required for TypeScript projects
1820
replace({
1921
'process.env.NODE_ENV': JSON.stringify(__ENV__),
2022
preventAssignment: true,

playground/tsconfig.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// A tsconfig.json file is only required for TypeScript projects
2+
{
3+
"compilerOptions": {
4+
"allowJs": true,
5+
"experimentalDecorators": false, // Required for LWC decorators to work
6+
"module": "nodenext",
7+
"noEmit": true,
8+
"skipLibCheck": true,
9+
"strict": true,
10+
"target": "esnext" // Required for LWC decorators to work
11+
}
12+
}

0 commit comments

Comments
 (0)