isoflow/webpack/dev.config.js

42 lines
904 B
JavaScript
Raw Normal View History

2023-03-24 23:32:36 +00:00
const path = require("path");
const HtmlWebPackPlugin = require("html-webpack-plugin");
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"),
},
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"],
plugins: [new TsconfigPathsPlugin()],
2023-03-24 23:32:36 +00:00
},
plugins: [
new HtmlWebPackPlugin({
template: path.resolve(__dirname, "../src/index.html"),
}),
],
};