I am having trouble configuring Webpack with Babel and React.
Here is my config file-
var webpack = require('webpack');
var path = require('path');
var BUILD_DIR = path.resolve(__dirname, 'src/client/public');
var APP_DIR = path.resolve(__dirname, './app/javascripts');
var config = {
entry: APP_DIR + '/app1.jsx',
output: {
path: BUILD_DIR,
filename: 'bundle.js'
}
};
module : {
loaders : [
{
test : /\.jsx?/,
include : APP_DIR,
xclude: /node_modules/,
loader : 'babel-loader',
query: {
presets: ['es2015']
}
}
]
}
module.exports = config;
Here is my babelrc file
{
"presets" : ["es2015", "react"]
}
I have tried the steps as described in here but still getting config error as mentioned in the title.