Skip to content

Instantly share code, notes, and snippets.

@slorber
Created April 4, 2016 11:38
Show Gist options
  • Save slorber/64f3cf4a2583ace1e87511bb3757725b to your computer and use it in GitHub Desktop.
Save slorber/64f3cf4a2583ace1e87511bb3757725b to your computer and use it in GitHub Desktop.
var babelLoader = 'babel?presets[]=es2015&presets[]=react&plugins[]=syntax-object-rest-spread';
if (opts.hot) {
config.entry.app = [
'webpack-dev-server/client?' + opts.publicPath,
'webpack/hot/only-dev-server',
config.entry.app,
];
config.module.loaders.push({
test: /\.jsx?$/,
include: path.resolve('./src'),
exclude: [
/node_modules/,
path.resolve('./src/common/annotator-full.js')
],
loader: 'react-hot!' + babelLoader,
});
config.plugins.push(new webpack.HotModuleReplacementPlugin());
}
else {
config.module.loaders.push({
test: /\.jsx?$/,
include: path.resolve('./src'),
exclude: [
/node_modules/,
path.resolve('./src/common/annotator-full.js')
],
loader: babelLoader,
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment