Instantly share code, notes, and snippets.

Embed
What would you like to do?
Basic webpack file for ReactJS based proejcts.
const path = require('path')
const webpack = require('webpack')
module.exports = {
entry: {
main: "./src/js/index.js"
},
output: {
path: path.join(__dirname, 'build', 'js'),
filename: "[name].js"
},
resolve: {
extensions: ['', '.js', '.jsx']
},
devtool: 'source-map',
module: {
loaders: [
{
test: /.jsx?$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
presets: ['es2015', 'react']
}
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment