-
Notifications
You must be signed in to change notification settings - Fork 42
/
webpack.config.js
50 lines (49 loc) · 1.04 KB
/
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
49
50
const path = require("path");
module.exports = {
mode: "development",
devtool: "source-map",
entry: {
"index.js": "./docs/index.tsx",
},
output: {
path: path.join(__dirname, "build"),
filename: "[name]",
},
module: {
rules: [
{
test: /\.css/,
use: ["style-loader", "css-loader"],
},
{
test: /\.jsx?|\.tsx?/,
exclude: /(node_modules)/,
use: {
loader: "babel-loader",
options: {
babelrc: false,
configFile: false,
presets: [
[
"@babel/preset-env",
{
targets: { browsers: ["defaults"] },
},
],
["@babel/preset-react", { development: true }],
["@babel/preset-typescript"],
],
},
},
},
],
},
resolve: {
extensions: [".js", ".jsx", ".ts", ".tsx"],
},
devServer: {
static: path.join(__dirname, "./build"),
port: 8080,
hot: true,
},
};