2020-09-21 02:29:13 +03:00
|
|
|
import * as path from 'path';
|
2021-09-20 03:33:29 +03:00
|
|
|
import HtmlWebpackPlugin from 'html-webpack-plugin';
|
|
|
|
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
|
2020-08-05 15:42:25 +03:00
|
|
|
|
2020-09-21 02:29:13 +03:00
|
|
|
export default {
|
2021-09-20 03:33:29 +03:00
|
|
|
mode: 'development',
|
|
|
|
entry: './src/index.ts',
|
|
|
|
devtool: 'eval-source-map',
|
|
|
|
devServer: {
|
|
|
|
static: './dist',
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new HtmlWebpackPlugin({
|
|
|
|
template: './index.html',
|
|
|
|
}),
|
|
|
|
new ForkTsCheckerWebpackPlugin(),
|
2020-08-05 15:42:25 +03:00
|
|
|
],
|
|
|
|
output: {
|
|
|
|
filename: 'bundle.js',
|
2021-09-20 03:33:29 +03:00
|
|
|
path: path.join(__dirname, 'dist'),
|
|
|
|
clean: true,
|
2020-08-05 15:42:25 +03:00
|
|
|
},
|
|
|
|
module: {
|
2020-08-05 16:12:31 +03:00
|
|
|
rules: [
|
|
|
|
{
|
2020-09-21 02:29:13 +03:00
|
|
|
test: /\.(js|ts)$/,
|
2020-08-05 16:12:31 +03:00
|
|
|
exclude: /node_modules/,
|
2021-09-20 03:33:29 +03:00
|
|
|
use: {
|
|
|
|
loader: 'babel-loader',
|
|
|
|
options: {
|
|
|
|
presets: [
|
|
|
|
['@babel/preset-env', { targets: 'defaults' }],
|
|
|
|
'@babel/preset-typescript',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2020-08-08 23:26:39 +03:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2020-09-21 02:29:13 +03:00
|
|
|
resolve: {
|
2021-09-22 05:57:17 +03:00
|
|
|
extensions: ['.js', '.ts'],
|
2020-09-21 02:29:13 +03:00
|
|
|
},
|
2020-08-05 15:42:25 +03:00
|
|
|
};
|