Skip to content

Instantly share code, notes, and snippets.

@Nazehs
Created October 5, 2022 19:30
Show Gist options
  • Save Nazehs/499bc48ae117a0054a7728283bf5b5d2 to your computer and use it in GitHub Desktop.
Save Nazehs/499bc48ae117a0054a7728283bf5b5d2 to your computer and use it in GitHub Desktop.
dummy config
const webpack = require("webpack");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const path = require("path");
require("dotenv").config();
module.exports = {
context: path.join(__dirname, "client"),
devtool: "source-map",
entry: [
"regenerator-runtime/runtime.js",
"babel-polyfill",
"webpack-hot-middleware/client",
"../client/index.jsx",
],
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: "babel-loader",
},
{
test: /\.scss$/,
use: [MiniCssExtractPlugin.loader, "css-loader", "sass-loader"],
},
{
test: /\.(woff2?|jpe?g|png|gif|ico)$/,
use: "file-loader?name=./assets/images/[name].[ext]",
},
{
test: /\.css$/,
use: ["style-loader", "css-loader"],
},
],
},
resolve: {
extensions: [".js", ".jsx", ".css"],
fallback: {
console: ["info", "warn", "error", "log"],
fs: false,
net: false,
tls: false,
dns: false,
},
},
output: {
path: `${__dirname}/client/dist`,
filename: "bundle.js",
publicPath: "/",
},
plugins: [
new webpack.NoEmitOnErrorsPlugin(),
new webpack.HotModuleReplacementPlugin(),
new MiniCssExtractPlugin(),
new webpack.DefinePlugin({
"process.env.JWTSECRET": JSON.stringify(process.env.JWTSECRET),
"process.env.mailgunApikey": JSON.stringify(process.env.mailgunApikey),
}),
],
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment