73 lines
1.9 KiB
JavaScript
73 lines
1.9 KiB
JavaScript
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: /\.(js|jsx)$/, // include .jsx files
|
|
exclude: /node_modules/,
|
|
use: {
|
|
loader: "babel-loader",
|
|
},
|
|
},
|
|
{
|
|
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/ },
|
|
// ],
|
|
// };
|