-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
38 lines (37 loc) · 899 Bytes
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
const path = require('path')
const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports = {
entry: path.join(__dirname, 'src', 'app.ts'),
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
},
resolve: {
extensions: ['.tsx', '.ts', '.js', '.json'],
},
module: {
rules: [
// all files with a '.ts' or '.tsx' extension will be handled by 'ts-loader'
{
test: /\.tsx?$/,
use: ['babel-loader', 'ts-loader'],
exclude: /node_modules/,
},
],
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new HtmlWebpackPlugin({
template: path.join('src', 'index.html'),
filename: './index.html',
}),
],
devServer: {
contentBase: path.join(__dirname, 'dist'),
hot: true,
overlay: true,
port: 3000,
host: '0.0.0.0',
},
}