Skip to content

Instantly share code, notes, and snippets.

@anshulrgoyal
Created January 6, 2019 07:01
Show Gist options
  • Select an option

  • Save anshulrgoyal/cd4f4432705e1251f9f87559a5e3e72a to your computer and use it in GitHub Desktop.

Select an option

Save anshulrgoyal/cd4f4432705e1251f9f87559a5e3e72a to your computer and use it in GitHub Desktop.
WebPack Config File
const path = require("path");
module.exports = {
entry: "./src/index.js",
mode: "development",
output: {
filename: "./main.js"
},
devServer: {
contentBase: path.join(__dirname, "dist"),
compress: true,
port: 9000,
watchContentBase: true,
progress: true
},
module: {
rules: [
{
test: /\.m?js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: "babel-loader"
}
},
{
test: /\.css$/,
use: [
"style-loader",
{
loader: "css-loader",
options: {
modules: true
}
}
]
},
{
test: /\.(png|svg|jpg|gif)$/,
use: ["file-loader"]
}
]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment