Skip to content

Instantly share code, notes, and snippets.

@ArjunHariharan
Last active October 30, 2016 16:18
Show Gist options
  • Save ArjunHariharan/4f2a91a5165d017251c6ff98e5a413b4 to your computer and use it in GitHub Desktop.
Save ArjunHariharan/4f2a91a5165d017251c6ff98e5a413b4 to your computer and use it in GitHub Desktop.
var webpack = require('webpack');
var path = require('path');
// Build Directory
// Webpack will put the bundled assets in this directory.
var BUILD_DIR = path.resolve(__dirname, 'build');
// App directory
// Our source code lies here.
var APP_DIR = path.resolve(__dirname, 'src');
// Webpack configuration
var config = {
// Entry point for webpack.
entry: APP_DIR + '/index.jsx',
// Name and path of the of the output file.
// bundle.js is the output file which will be placed in the build directory.
output: {
path: BUILD_DIR,
filename: 'bundle.js',
},
// Use babel for compile jsx code.
module : {
loaders : [
{
test : /\.jsx?/,
include : APP_DIR,
loader : 'babel'
}
]
}
};
module.exports = config;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment