-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
48 lines (47 loc) · 1005 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
39
40
41
42
43
44
45
46
47
48
const path = require("path");
const TsconfigPathsPlugin = require("tsconfig-paths-webpack-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");
module.exports = {
context: __dirname,
entry: "./src/index.ts",
module: {
rules: [
{
test: /\.css$/i,
use: ["style-loader", "css-loader"]
},
{
test: /\.tsx?$/,
use: "ts-loader",
exclude: /node_modules/
},
{
test: /\.html$/i,
loader: "html-loader"
}
]
},
resolve: {
extensions: [".tsx", ".ts", ".js"],
plugins: [
new TsconfigPathsPlugin({
configFile: path.resolve(__dirname, "./tsconfig.json")
})
]
},
devtool: "source-map",
devServer: {
contentBase: "./dist/app"
},
plugins: [
new HtmlWebpackPlugin({
title: "Demo App",
template: "./src/index.html"
})
],
output: {
path: path.join(__dirname, "dist/app"),
filename: "[name].bundle.js",
clean: true
}
};