Skip to content

Instantly share code, notes, and snippets.

@sivaraj-v
Created March 22, 2018 13:15
Show Gist options
  • Save sivaraj-v/fa0dc597f89da4af1acd86823951d285 to your computer and use it in GitHub Desktop.
Save sivaraj-v/fa0dc597f89da4af1acd86823951d285 to your computer and use it in GitHub Desktop.
Webpack configuration file
const path = require("path");
const webpack = require("webpack");
const webpack_rules = [];
const webpackOption = {
entry: "./app.js",
output: {
path: path.resolve(__dirname, "dist"),
filename: "bundle.js",
},
module: {
rules: webpack_rules
}
};
let babelLoader = {
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: "babel-loader",
options: {
presets: ["@babel/preset-env"]
}
}
};
webpack_rules.push(babelLoader);
module.exports = webpackOption;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment