feat: use TypeScript in the client (#42124)

This commit is contained in:
Oliver Eyton-Williams
2021-05-17 20:53:41 +02:00
committed by GitHub
parent e190dd610a
commit 66dae77fc5
15 changed files with 332 additions and 32 deletions

View File

@ -37,8 +37,8 @@ module.exports = (env = {}) => {
module: {
rules: [
{
test: /\.jsx?$/,
include: [path.join(__dirname, 'src/client/')],
test: /\.(js|ts)$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
@ -47,7 +47,8 @@ module.exports = (env = {}) => {
[
'@babel/preset-env',
{ modules: false, targets: '> 0.25%, not dead' }
]
],
'@babel/preset-typescript'
],
plugins: [
'@babel/plugin-transform-runtime',
@ -75,7 +76,8 @@ module.exports = (env = {}) => {
util: false,
stream: false,
process: require.resolve('process/browser')
}
},
extensions: ['.js', '.ts']
}
};
};