Skip to content

Instantly share code, notes, and snippets.

@gdyrrahitis
Created April 28, 2018 18:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gdyrrahitis/dae6a6533705128754ab3af137bbeecb to your computer and use it in GitHub Desktop.
Save gdyrrahitis/dae6a6533705128754ab3af137bbeecb to your computer and use it in GitHub Desktop.
const webpack = require("webpack");
const path = require("path");
const htmlWebpackPlugin = require("html-webpack-plugin");
module.exports = {
entry: [
"react-hot-loader/patch",
"./src/main.js"
],
output: {
path: path.resolve(__dirname, "dist"),
filename: "bundle.js"
},
module: {
rules: [
{
test: /\.css$/, use: ["style-loader", "css-loader"]
},
{
test: /\.(js|jsx)$/, exclude: /node_modules/, use: "babel-loader"
}
]
},
plugins: [
new htmlWebpackPlugin({ template: "./index.html" }),
new webpack.HotModuleReplacementPlugin()
],
mode: "development",
devServer: {
contentBase: "./dist",
port: 8082,
hot: true
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment