-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
32 lines (31 loc) · 992 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
const path = require("path");
const TerserPlugin = require("terser-webpack-plugin");
module.exports = {
entry: "./src/index.js", // Entry point for your app
output: {
filename: "bundle.js", // Output bundle file
path: path.resolve(__dirname, "public"), // Output directory
},
module: {
rules: [
{
test: /\.js$/, // Look for .js files
exclude: /node_modules/, // Exclude node_modules from transpilation
use: {
loader: "babel-loader", // Use babel-loader for modern JavaScript
},
},
],
},
resolve: {
modules: [path.resolve(__dirname, "src"), "node_modules"], // Resolves module paths
},
mode: "development", // You can change this to 'production' for optimized builds,
optimization: {
minimize: true,
minimizer: [new TerserPlugin()],
},
devServer: {
server: "https",
},
};