Skip to content

Commit 103d0a8

Browse files
committed
docs: fix typescript-without-babel example (fixes #217)
1 parent 747c19b commit 103d0a8

File tree

3 files changed

+224
-4
lines changed

3 files changed

+224
-4
lines changed

examples/typescript-without-babel/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"@types/react-dom": "^16.9.8",
1414
"babel-loader": "^8.1.0",
1515
"cross-env": "^7.0.2",
16+
"fork-ts-checker-webpack-plugin": "^5.2.1",
1617
"html-webpack-plugin": "^4.4.1",
1718
"react-refresh": "^0.8.3",
1819
"ts-loader": "^8.0.4",

examples/typescript-without-babel/webpack.config.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const path = require('path');
22
const ReactRefreshPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
3+
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
34
const HtmlWebpackPlugin = require('html-webpack-plugin');
45

56
const isDevelopment = process.env.NODE_ENV !== 'production';
@@ -19,13 +20,17 @@ module.exports = {
1920
loader: 'babel-loader',
2021
options: { plugins: ['react-refresh/babel'] },
2122
},
22-
'ts-loader',
23+
{
24+
loader: 'ts-loader',
25+
options: { transpileOnly: true },
26+
},
2327
].filter(Boolean),
2428
},
2529
],
2630
},
2731
plugins: [
2832
isDevelopment && new ReactRefreshPlugin(),
33+
new ForkTsCheckerWebpackPlugin(),
2934
new HtmlWebpackPlugin({
3035
filename: './index.html',
3136
template: './public/index.html',

0 commit comments

Comments
 (0)