-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.ts
49 lines (44 loc) · 929 Bytes
/
webpack.config.ts
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
39
40
41
42
43
44
45
46
47
48
49
import HTMLPlugin from 'html-webpack-plugin';
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
module.exports = {
entry: './src',
output: {
filename: 'app.js'
},
resolve: {
extensions: ['.js', '.ts', '.tsx']
},
plugins: [
new HTMLPlugin({ template: 'index.html' }),
new MiniCssExtractPlugin({ filename: 'main.css' })
],
module: {
rules: [
{
test: /\.tsx?$/,
exclude: /node_modules/,
loader: 'awesome-typescript-loader'
},
{
test: /\.html$/,
loader: 'html-loader',
options: {
attrs: ['link:href']
}
},
{
test: /\.(jpg|png|svg)$/,
loader: 'file-loader'
},
{
test: /\.css$/,
include: /styles/,
loader: [MiniCssExtractPlugin.loader, 'css-loader']
}
]
},
devServer: {
port: 8080,
historyApiFallback: true
}
};