Skip to content

Instantly share code, notes, and snippets.

@akshendra
Last active January 7, 2017 08:16
Show Gist options
  • Save akshendra/01803089956f2f2cc01dbf19dc903d15 to your computer and use it in GitHub Desktop.
Save akshendra/01803089956f2f2cc01dbf19dc903d15 to your computer and use it in GitHub Desktop.
webpack config for react projects
'use strict';
const p = require('path');
// const webpack = require('webpack');
module.exports = {
// we are going to read from here
entry: p.resolve(__dirname, 'src/app.js'),
// where we gonna spit it out
output: {
path: p.resolve(__dirname, 'dist'),
filename: 'app.bundle.js',
},
// modules
module: {
loader: [{
test: /\.js$/,
loader: 'babel-loader',
query: {
presets: ['es2015', 'react'],
},
}],
},
// stats
stats: {
colors: true,
},
devtool: 'source-map',
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment