Created
February 4, 2017 20:01
-
-
Save achadha235/3b0000b4e24f82545e63bf1c19163c69 to your computer and use it in GitHub Desktop.
Webpack 2.0 Rules Configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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