-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
41 lines (36 loc) · 944 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
/**
* Webpack Configuration
*
* This module exports the configuration object for Webpack, which specifies
* how to bundle and build the application's source code. It uses TypeScript
* for transpiling TypeScript files, sets up the resolution for various file
* extensions, and applies the necessary loaders and plugins.
*/
const webpack = require("webpack");
module.exports = {
// Entry point for the application
entry: "./src/index.tsx",
// Resolve file extensions
resolve: {
extensions: [".ts", ".tsx", ".js", ".json"],
},
// Module rules for transpiling TypeScript files
module: {
rules: [
{
test: /\.tsx?$/,
exclude: /node_modules/,
use: {
loader: "ts-loader",
},
},
],
},
// Plugins for environment configuration
plugins: [
// Plugin to define environment variables
new webpack.EnvironmentPlugin({
PORT: "3000",
}),
],
};