Spaces:
Sleeping
Sleeping
Delete webpack.config.js
Browse files- webpack.config.js +0 -59
webpack.config.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
| 1 |
-
const path = require("path");
|
| 2 |
-
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
| 3 |
-
const Dotenv = require("dotenv-webpack"); // Add this line
|
| 4 |
-
const CopyWebpackPlugin = require("copy-webpack-plugin");
|
| 5 |
-
|
| 6 |
-
module.exports = {
|
| 7 |
-
entry: "./src/index.js",
|
| 8 |
-
output: {
|
| 9 |
-
path: path.resolve(__dirname, "build"),
|
| 10 |
-
filename: "bundle.js",
|
| 11 |
-
publicPath: "/", // Ensure correct routing for React Router
|
| 12 |
-
},
|
| 13 |
-
module: {
|
| 14 |
-
rules: [
|
| 15 |
-
{
|
| 16 |
-
test: /\.jsx?$/,
|
| 17 |
-
exclude: /node_modules/,
|
| 18 |
-
use: {
|
| 19 |
-
loader: "babel-loader",
|
| 20 |
-
options: {
|
| 21 |
-
presets: ["@babel/preset-env", "@babel/preset-react"],
|
| 22 |
-
},
|
| 23 |
-
},
|
| 24 |
-
},
|
| 25 |
-
{
|
| 26 |
-
test: /\.css$/,
|
| 27 |
-
use: ["style-loader", "css-loader"],
|
| 28 |
-
},
|
| 29 |
-
{
|
| 30 |
-
test: /\.(png|jpe?g|gif|svg)$/i,
|
| 31 |
-
type: "asset/resource",
|
| 32 |
-
},
|
| 33 |
-
],
|
| 34 |
-
},
|
| 35 |
-
resolve: {
|
| 36 |
-
extensions: [".js", ".jsx"],
|
| 37 |
-
},
|
| 38 |
-
plugins: [
|
| 39 |
-
new HtmlWebpackPlugin({
|
| 40 |
-
template: "./public/index.html",
|
| 41 |
-
filename: "index.html",
|
| 42 |
-
}),
|
| 43 |
-
new CopyWebpackPlugin({
|
| 44 |
-
patterns: [{ from: "netlify.toml", to: "" }],
|
| 45 |
-
}),
|
| 46 |
-
new Dotenv({
|
| 47 |
-
path: "./.env", // Path to your .env file
|
| 48 |
-
safe: true, // Ensures all variables are defined
|
| 49 |
-
systemvars: true, // Also load system environment variables
|
| 50 |
-
}),
|
| 51 |
-
],
|
| 52 |
-
devServer: {
|
| 53 |
-
static: path.join(__dirname, "dist"),
|
| 54 |
-
port: 3030,
|
| 55 |
-
historyApiFallback: true, // Supports React Router
|
| 56 |
-
open: true, // Opens browser automatically
|
| 57 |
-
},
|
| 58 |
-
mode: "development", // Explicitly set mode (optional, since you use --mode)
|
| 59 |
-
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|