2025-07-25
This commit is contained in:
65
frontend/webpack.config.js
Normal file
65
frontend/webpack.config.js
Normal file
@@ -0,0 +1,65 @@
|
||||
const path = require("path");
|
||||
|
||||
module.exports = {
|
||||
entry: ["./src/index.js"],
|
||||
output: {
|
||||
filename: "bundle.js",
|
||||
path: path.resolve(__dirname, "dist"),
|
||||
publicPath: "http://localhost:3000/dist/", // webpack-dev-server URL
|
||||
},
|
||||
mode: "development",
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.scss$/,
|
||||
use: [
|
||||
"style-loader", // Injects styles into DOM
|
||||
"css-loader", // Turns CSS into CommonJS
|
||||
"sass-loader", // Compiles SCSS to CSS
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.(woff2?|ttf|otf|eot)$/,
|
||||
type: "asset/resource",
|
||||
generator: {
|
||||
filename: "fonts/[name][ext]",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
devServer: {
|
||||
static: false,
|
||||
hot: true,
|
||||
port: 3000,
|
||||
headers: {
|
||||
"Access-Control-Allow-Origin": "*",
|
||||
},
|
||||
proxy: [
|
||||
{
|
||||
context: () => true,
|
||||
target: "http://localhost:8000",
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
ignoreWarnings: [
|
||||
// Ignore all warnings from a specific file (e.g., Bootstrap's Sass)
|
||||
{ message: /Deprecation Warning/ },
|
||||
{ message: /repetitive deprecation warnings/ },
|
||||
],
|
||||
};
|
||||
// module.exports = {
|
||||
// // ... other webpack configurations
|
||||
// ignoreWarnings: [
|
||||
// // Ignore all warnings from a specific file (e.g., Bootstrap's Sass)
|
||||
// { file: /_bootstrap\.scss$/, message: /^DEPRECATION WARNING/ },
|
||||
|
||||
// // Alternatively, ignore all warnings containing a specific string
|
||||
// { message: /DEPRECATION WARNING: Sass\'s behavior for declarations/ },
|
||||
|
||||
// // Or, ignore warnings based on a general pattern
|
||||
// // This example ignores all warnings from node_modules that are deprecation warnings
|
||||
// { file: /node_modules/, message: /DEPRECATION WARNING/ },
|
||||
// ],
|
||||
// };
|
||||
Reference in New Issue
Block a user