'use strict';
global.WEBPACK_ENV = "production";
var path = require("path");
var UglifyJsPlugin = require("webpack-uglify-js-plugin");
var OptimizeCssAssetsPlugin = require("optimize-css-assets-webpack-plugin");
var webpack = require("webpack");
var StatsPlugin = require('stats-webpack-plugin');
var publicPath = '/webpack/';

var conf = {
  mode: "none",
  // Was "eval", but that did not go well with our CSP
  devtool: "eval",
  entry: {
    "app_bundle": "./webpack/entry.tsx",
    "front_page": "./webpack/front_page/index.tsx",
    "password_reset": "./webpack/password_reset/index.tsx",
    "tos_update": "./webpack/tos_update/index.tsx"
  },
  output: {
    path: path.join(__dirname, '..', 'public', 'webpack'),
    publicPath,
    filename: '[name]-[chunkhash].js',
    chunkFilename: '[id].[name].[chunkhash].js'
  },
  module: {
    rules: [
      {
        test: [/\.scss$/, /\.css$/],
        use: ["style-loader", "css-loader", "sass-loader"]
      },
      {
        test: /\.tsx?$/,
        use: "ts-loader"
      },
      {
        test: [/\.woff$/, /\.woff2$/, /\.ttf$/],
        use: "url-loader"
      },
      {
        test: [/\.eot$/, /\.svg(\?v=\d+\.\d+\.\d+)?$/],
        use: "file-loader"
      }
    ]
  },
  // Allows imports without file extensions.
  resolve: {
    extensions: [".js", ".ts", ".tsx", ".css", ".scss", ".json"]
  },
  plugins: [
    new StatsPlugin('manifest.json', {
      // We only need assetsByChunkName
      chunkModules: false,
      source: false,
      chunks: false,
      modules: false,
      assets: true
    }),
    new OptimizeCssAssetsPlugin({
      assetNameRegExp: /\.css$/g,
      cssProcessor: require("cssnano"),
      cssProcessorOptions: { discardComments: { removeAll: true } },
      canPrint: true
    }),
    new UglifyJsPlugin({
      cacheFolder: path.resolve(__dirname, "../public/dist/cached_uglify/"),
      debug: true,
      minimize: true,
      sourceMap: true,
      screw_ie8: true,
      output: { comments: false },
      compressor: { warnings: false }
    }),
    new webpack.DefinePlugin({
      'process.env': {
        'NODE_ENV': JSON.stringify("production")
      }
    })
  ],
  node: {
    fs: "empty"
  }
};
var accessToken = process.env.ROLLBAR_ACCESS_TOKEN
if (accessToken) {
  var RollbarSourceMapPlugin = require('rollbar-sourcemap-webpack-plugin')
  var version = process.env.BUILT_AT || process.env.HEROKU_SLUG_COMMIT || "????"
  var plugin = new RollbarSourceMapPlugin({accessToken, version, publicPath})
  conf.plugins.push(plugin)
}
module.exports = conf;

@@ -2270,16 +2270,73 @@
 oken) %7B%0A
+  console.log(%22============= PERFORMING ROLLBAR CONFIG%22)%0A
   var Ro
@@ -2589,16 +2589,80 @@
 plugin)%0A
+%7D else %7B%0A  console.log(%22============= SKIPPING ROLLBAR CONFIG%22)%0A
 %7D%0Amodule

Debug stuff