Skip to content

Instantly share code, notes, and snippets.

@achadha235
Created February 4, 2017 20:01
Show Gist options
  • Select an option

  • Save achadha235/3b0000b4e24f82545e63bf1c19163c69 to your computer and use it in GitHub Desktop.

Select an option

Save achadha235/3b0000b4e24f82545e63bf1c19163c69 to your computer and use it in GitHub Desktop.
Webpack 2.0 Rules Configuration
const HtmlWebpackPlugin = require('html-webpack-plugin'); //installed via npm
const webpack = require('webpack'); //to access built-in plugins
var path = require('path');
module.exports = {
entry: './src/mebot.jsx',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'mebot.bundle.js',
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: [
{
loader:"babel-loader",
options: {
presets: ['es2015', 'react'],
}
}
]
}
]
},
plugins: [
new webpack.optimize.UglifyJsPlugin(),
new HtmlWebpackPlugin({template: './src/index.html'})
],
devtool: "source-map"
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment