Skip to content

Instantly share code, notes, and snippets.

@OtayNacef
Created March 7, 2021 20:20
Show Gist options
  • Save OtayNacef/539723d317fbb6a5ee8f21b88986241c to your computer and use it in GitHub Desktop.
Save OtayNacef/539723d317fbb6a5ee8f21b88986241c to your computer and use it in GitHub Desktop.
const webpack = require("webpack");
const path = require("path");
module.exports = {
entry: path.resolve(__dirname, "./src/index.js"),
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: ["babel-loader"],
},
],
},
resolve: {
extensions: ["*", ".js", ".jsx"],
},
output: {
path: path.resolve(__dirname, "./dist"),
filename: "bundle.js",
},
plugins: [new webpack.HotModuleReplacementPlugin()],
devServer: {
contentBase: path.resolve(__dirname, "./dist"),
hot: true,
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment