Skip to content

Instantly share code, notes, and snippets.

@witnessmenow
Created May 5, 2016 13:15
Show Gist options
  • Save witnessmenow/49ea19ca4553c8796c74fadbafca0014 to your computer and use it in GitHub Desktop.
Save witnessmenow/49ea19ca4553c8796c74fadbafca0014 to your computer and use it in GitHub Desktop.
Example production webpack configuration for wrapping a react component using webpack
const webpack = require('webpack');
module.exports = {
entry: './wrapper.js',
output: {
libraryTarget: 'var',
library: 'showChatTemplate',
path: 'builds',
filename: 'chat-template-min.js',
},
module: {
loaders: [
{
test: /\.js/,
loader: 'babel',
include: __dirname,
}
],
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
})
],
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment