Created
September 20, 2016 10:22
-
-
Save cAstraea/502492ab6a42d4d1b3631ba45bb4da5e 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 production = process.env.NODE_ENV === 'production'; | |
var path = require('path'); | |
var webpack = require('webpack'); | |
var UnminifiedWebpackPlugin = require('unminified-webpack-plugin'); | |
module.exports = { | |
entry: { | |
product: './web/js/productApp.js' | |
}, | |
output: { | |
path: './web/builds', | |
filename: '[name].min.js', | |
publicPath: production ? '/builds/' : 'http://localhost:8080/builds/' | |
}, | |
plugins: | |
[ | |
new webpack.optimize.UglifyJsPlugin({ | |
compress: { | |
warnings: false | |
} | |
}), | |
new UnminifiedWebpackPlugin() | |
], | |
resolve: { | |
extensions: ['', '.js', '.jsx'] | |
}, | |
module: { | |
loaders: [ | |
{ | |
test: /\.js$/, | |
exclude: /node_modules/, | |
loader: "babel-loader", | |
}, | |
{ | |
test: /\.css$/, | |
loader: "style!css" | |
}, | |
{ | |
test: /\.(png|gif|jpe?g|svg?(\?v=[0-9]\.[0-9]\.[0-9])?)$/i, | |
loader: 'url?limit=10000', | |
} | |
] | |
}, | |
devServer: { | |
hot: true, | |
contentBase: './web/', | |
headers: { "Access-Control-Allow-Origin": "*" } | |
}, | |
devtool: production ? false : '#inline-source-map' | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment