const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; const autoprefixer = require('autoprefixer'); const cssvars = require('postcss-simple-vars'); const webpack = require('webpack'); const UglifyJSPlugin = require('uglifyjs-webpack-plugin') const HtmlWebpackPlugin = require('html-webpack-plugin'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); const ManifestPlugin = require('webpack-manifest-plugin'); const url = require('url'); var paths = require('./paths'); var getClientEnvironment = require('./env'); var cssvariables = require(paths.appSrc + '/theme/variables'); const postcssPlugins = [ autoprefixer({ browsers: [ '>1%', 'last 4 versions', 'Firefox ESR', 'not ie < 9', // React doesn't support IE8 anyway ] }), cssvars({ variables: function () { return Object.assign({}, cssvariables); }, silent: true }), ]; function ensureSlash(path, needsSlash) { var hasSlash = path.endsWith('/'); if (hasSlash && !needsSlash) { return path.substr(path, path.length - 1); } else if (!hasSlash && needsSlash) { return path + '/'; } else { return path; } } // We use "homepage" field to infer "public path" at which the app is served. // Webpack needs to know it to put the right