2015-09-25 18:43:28 +08:00
|
|
|
var path = require('path');
|
|
|
|
var webpack = require('webpack');
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
module: {
|
|
|
|
preLoaders: [
|
|
|
|
{ test: /\.js$/, loader: "source-map-loader" }
|
|
|
|
],
|
|
|
|
loaders: [
|
|
|
|
{ test: /\.json$/, loader: "json" },
|
|
|
|
{ test: /\.js$/, loader: "babel", include: path.resolve('./src') },
|
|
|
|
]
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
// alias any requires to the react module to the one in our path, otherwise
|
|
|
|
// we tend to get the react source included twice when using npm link.
|
|
|
|
react: path.resolve('./node_modules/react'),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
plugins: [
|
2015-10-14 16:20:18 +08:00
|
|
|
new webpack.IgnorePlugin(/^olm/),
|
|
|
|
new webpack.DefinePlugin({
|
|
|
|
'process.env': {
|
|
|
|
NODE_ENV: JSON.stringify(process.env.NODE_ENV)
|
|
|
|
}
|
|
|
|
})
|
2015-09-25 18:43:28 +08:00
|
|
|
],
|
|
|
|
devtool: 'source-map'
|
|
|
|
};
|