This is only if you’re using Babel 6. When installing Webpack + Babel for the first time, npm is going to fetch Babel 6 unless otherwise specificed.
Babel 6 is breaks compatibility with plugins so if you’re using many plugins at this point in time, you will want to wait on upgrading to Babel 6. Last I checked, Webpack and many Webpack plugins were not tested with Babel 5.
This is also probably why something like this fix isn’t widely documented yet.
I got my webpack config to work with Babel 6 with this setup:
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel-loader',
include: [
path.resolve(__dirname, 'src'),
path.resolve(__dirname, 'node_modules', 'prosemirror')
],
// Need this here for prosemirror til it has own .babelrc
query: {
presets: ['es2015']
}
},
...
Edit: noticed that I’m doing the same thing as the OP, using query, but I’m also specifically including node_modules/prosemirror since I’m using it as a dependency.