Created
April 4, 2016 11:38
-
-
Save slorber/64f3cf4a2583ace1e87511bb3757725b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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