Skip to content

Commit

Permalink
webpack options for prod-build
Browse files Browse the repository at this point in the history
  • Loading branch information
tdumitrescu committed Jun 7, 2018
1 parent 1f86745 commit 1436624
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions webpack.config.js
Expand Up @@ -3,7 +3,10 @@ const HtmlWebpackPlugin = require(`html-webpack-plugin`);
const path = require(`path`);
const webpack = require(`webpack`);

const {BADGE} = process.env; // build standalone animal-badge for linking
const {
PROD, // productionized build
PUBLIC_PATH, // file-loader publicPath override
} = process.env;


const BABEL_LOADER = {
Expand All @@ -27,10 +30,13 @@ const fileLoaderOptions = {
};
const optionalPlugins = [];

if (BADGE) {
if (PROD) {
fileLoaderOptions.publicPath = `https://mixpanel.github.io/panel-farm/images/`;
optionalPlugins.push(new webpack.optimize.UglifyJsPlugin());
}
if (PUBLIC_PATH) {
fileLoaderOptions.publicPath = PUBLIC_PATH;
}

const webpackConfig = {
entry: {
Expand Down

0 comments on commit 1436624

Please sign in to comment.