Skip to content

Instantly share code, notes, and snippets.

@yeti-detective
Last active March 4, 2017 03:51
Show Gist options
  • Save yeti-detective/536a637c6f44e02d57344adb526709fa to your computer and use it in GitHub Desktop.
Save yeti-detective/536a637c6f44e02d57344adb526709fa to your computer and use it in GitHub Desktop.
var path = require('path'); // You know what path is for
var webpack = require('webpack'); // obviously it needs webpack
module.exports = {
/*
the entry key defines the file that will be the entry point. In our case, index.jsx
*/
  entry: path.join(__dirname + '/index.jsx'),
/*
the output key names the file and location of the transpiled javascript
*/
  output: { path: path.join(__dirname), filename: 'bundle.js' },
  module: {
/*
loaders tells webpack what kind of files we are loading. In our case .jsx
*/
    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