Created
November 28, 2016 13:22
-
-
Save txm/9d9f2efc1d6582dd4aa4f9bd83088601 to your computer and use it in GitHub Desktop.
This file contains 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
'use strict'; | |
let path = require('path'); | |
let webpack = require('webpack'); | |
let config = { | |
entry: [ | |
'./src/react/index.jsx' | |
], | |
resolve: { | |
extensions: ['', '.js', '.jsx'] | |
}, | |
output: { | |
path: path.resolve(__dirname, 'build/public/'), | |
filename: 'bundle.js' | |
}, | |
module: { | |
loaders: [ | |
{ | |
test: /\.css$/, | |
loader: 'style!css' | |
}, | |
{ | |
test: /\.jsx?$/, | |
loader: 'babel' | |
}, | |
{ | |
test: /\.svg(\?v=\d+.\d+.\d+)?$/, | |
loader: 'file-loader?limit=10000&mimetype=image/svg+xml' | |
}, | |
{ | |
test: /\.ttf(\?v=\d+.\d+.\d+)?$/, | |
loader: 'file-loader?limit=10000&mimetype=application/octet-stream' | |
}, | |
{ | |
test: /\.(png|woff|woff2|eot|json)$/, | |
loader: 'file-loader' | |
}, | |
{ | |
test: /\.jsx?$/, | |
exclude: /node_modules/, | |
loader: 'react-hot!babel' | |
} | |
], | |
}, | |
devServer: { | |
inline:true, | |
hot:true, | |
proxy: { | |
'/api/*': { | |
target: 'http://localhost:3000', | |
secure: false, | |
} | |
} | |
}, | |
plugins: [ | |
new webpack.DefinePlugin({ | |
'process.env':{ | |
'NODE_ENV': JSON.stringify('test') | |
} | |
}), | |
new webpack.optimize.UglifyJsPlugin({ | |
compress:{ | |
warnings: {} | |
}, | |
sourceMap: false, | |
mangle: false | |
}) | |
] | |
}; | |
module.exports = config; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment