redux-devtools/packages/react-json-tree/examples/webpack.config.ts
Nathan Bierema 47d102680a
chore(react-json-tree): fix example build (#887)
* chore(react-json-tree): fix example build

* Fix build
2021-09-22 03:24:10 +00:00

45 lines
983 B
TypeScript

import * as path from 'path';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
module.exports = {
mode: 'development',
entry: './src/index.tsx',
devtool: 'eval-source-map',
devServer: {
static: './dist',
},
plugins: [
new HtmlWebpackPlugin({
template: './index.html',
}),
new ForkTsCheckerWebpackPlugin(),
],
output: {
filename: 'bundle.js',
path: path.join(__dirname, 'dist'),
clean: true,
},
module: {
rules: [
{
test: /\.(js|ts)x?$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: [
['@babel/preset-env', { targets: 'defaults' }],
'@babel/preset-react',
'@babel/preset-typescript',
],
},
},
},
],
},
resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
};