|
@@ -1,40 +1,42 @@
|
|
1
|
+/* eslint-disable @typescript-eslint/no-var-requires */
|
|
2
|
+
|
1
|
3
|
const path = require('path');
|
2
|
4
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
3
|
5
|
|
4
|
6
|
module.exports = {
|
5
|
|
- mode: 'development',
|
6
|
|
- entry: './example/main.ts',
|
7
|
|
- devtool: 'inline-source-map',
|
8
|
|
- devServer: {
|
9
|
|
- contentBase: './dist',
|
10
|
|
- compress: true,
|
11
|
|
- hot: true,
|
12
|
|
- },
|
13
|
|
- plugins: [
|
14
|
|
- new HtmlWebpackPlugin({
|
15
|
|
- title: 'index'
|
16
|
|
- })
|
17
|
|
- ],
|
18
|
|
- output: {
|
19
|
|
- filename: '[name].bundle.js',
|
20
|
|
- path: path.resolve(__dirname, 'dist')
|
21
|
|
- },
|
22
|
|
- resolve: { extensions: ['.js', '.jsx', '.tsx', '.ts', '.json'] },
|
23
|
|
- module: {
|
24
|
|
- rules: [
|
|
7
|
+ mode: 'development',
|
|
8
|
+ entry: './example/main.ts',
|
|
9
|
+ devtool: 'inline-source-map',
|
|
10
|
+ devServer: {
|
|
11
|
+ contentBase: './dist',
|
|
12
|
+ compress: true,
|
|
13
|
+ hot: true,
|
|
14
|
+ },
|
|
15
|
+ plugins: [
|
|
16
|
+ new HtmlWebpackPlugin({
|
|
17
|
+ title: 'index',
|
|
18
|
+ }),
|
|
19
|
+ ],
|
|
20
|
+ output: {
|
|
21
|
+ filename: '[name].bundle.js',
|
|
22
|
+ path: path.resolve(__dirname, 'dist'),
|
|
23
|
+ },
|
|
24
|
+ resolve: { extensions: ['.js', '.jsx', '.tsx', '.ts', '.json'] },
|
|
25
|
+ module: {
|
|
26
|
+ rules: [
|
25
|
27
|
{
|
26
|
|
- // Include ts, tsx, js, and jsx files.
|
27
|
|
- test: /\.(ts|js)x?$/,
|
28
|
|
- exclude: /node_modules/,
|
29
|
|
- loader: 'babel-loader',
|
|
28
|
+ // Include ts, tsx, js, and jsx files.
|
|
29
|
+ test: /\.(ts|js)x?$/,
|
|
30
|
+ exclude: /node_modules/,
|
|
31
|
+ loader: 'babel-loader',
|
30
|
32
|
},
|
31
|
33
|
{
|
32
|
|
- test: /\.(ts|js)x?$/,
|
33
|
|
- loader: 'eslint-loader',
|
34
|
|
- options: {
|
35
|
|
- formatter: require('eslint-friendly-formatter')
|
36
|
|
- }
|
37
|
|
- }
|
|
34
|
+ test: /\.(ts|js)x?$/,
|
|
35
|
+ loader: 'eslint-loader',
|
|
36
|
+ options: {
|
|
37
|
+ formatter: require('eslint-friendly-formatter'),
|
|
38
|
+ },
|
|
39
|
+ },
|
38
|
40
|
],
|
39
|
|
- }
|
|
41
|
+ },
|
40
|
42
|
};
|