2023-03-24 23:32:36 +00:00
|
|
|
const path = require("path");
|
|
|
|
const HtmlWebPackPlugin = require("html-webpack-plugin");
|
2023-07-20 15:45:54 +00:00
|
|
|
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
|
2023-03-24 23:32:36 +00:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
mode: "development",
|
|
|
|
entry: "./src/index.tsx",
|
2023-04-03 00:56:43 +00:00
|
|
|
devtool: "eval-cheap-source-map",
|
2023-03-24 23:32:36 +00:00
|
|
|
output: {
|
|
|
|
filename: "main.js",
|
|
|
|
path: path.resolve(__dirname, "build"),
|
|
|
|
},
|
|
|
|
devServer: {
|
|
|
|
static: {
|
|
|
|
directory: path.join(__dirname, "build"),
|
|
|
|
},
|
2023-07-29 09:09:34 +00:00
|
|
|
allowedHosts: ['.csb.app'],
|
2023-03-24 23:32:36 +00:00
|
|
|
port: 3000,
|
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.(ts|tsx)$/,
|
|
|
|
use: "ts-loader",
|
|
|
|
exclude: /node_modules/,
|
|
|
|
},
|
2023-07-12 11:16:52 +00:00
|
|
|
{
|
|
|
|
test: /\.css$/i,
|
|
|
|
use: ["style-loader", "css-loader"],
|
|
|
|
},
|
2023-03-24 23:32:36 +00:00
|
|
|
],
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
extensions: [".tsx", ".ts", ".js"],
|
2023-07-20 15:45:54 +00:00
|
|
|
plugins: [new TsconfigPathsPlugin()],
|
2023-03-24 23:32:36 +00:00
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new HtmlWebPackPlugin({
|
|
|
|
template: path.resolve(__dirname, "../src/index.html"),
|
|
|
|
}),
|
|
|
|
],
|
|
|
|
};
|