-
Notifications
You must be signed in to change notification settings - Fork 715
Expand file tree
/
Copy pathwebpack.config.cjs
More file actions
42 lines (41 loc) · 863 Bytes
/
webpack.config.cjs
File metadata and controls
42 lines (41 loc) · 863 Bytes
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
const path = require("path");
module.exports = {
entry: ["./example/App.jsx", "./example/app.css"],
output: {
path: path.resolve(__dirname, "example"),
filename: "example.js",
publicPath: "/dist/",
},
resolve: {
extensions: [".ts", ".tsx", ".js", ".jsx"],
alias: {
src: path.resolve(__dirname, "src/"),
},
},
module: {
rules: [
{
test: /\.(ts|tsx)$/,
loader: "ts-loader",
exclude: /node_modules/,
},
{
test: /\.(js|jsx)$/,
loader: "babel-loader",
exclude: /node_modules/,
},
{
test: /\.css$/i,
use: ["style-loader", "css-loader"],
},
],
},
devServer: {
host: "0.0.0.0",
port: 8001,
open: true,
historyApiFallback: {
rewrites: [{ from: /\//, to: "/example/index.html" }],
},
},
};