Skip to content

Instantly share code, notes, and snippets.

@cAstraea
Created September 20, 2016 10:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cAstraea/502492ab6a42d4d1b3631ba45bb4da5e to your computer and use it in GitHub Desktop.
Save cAstraea/502492ab6a42d4d1b3631ba45bb4da5e to your computer and use it in GitHub Desktop.
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