import 'dotenv/config';
import cssnext from 'postcss-cssnext';
import cssimport from 'postcss-import';
import ExtractTextPlugin from 'extract-text-webpack-plugin';
import webpack from 'webpack'
import HappyPack from 'happypack';


export default {

    module: {

        devtool: 'source-map',

        debug: true,
        
        loaders: [
            {
                test: /\.css$/,
                loader: ExtractTextPlugin.extract(
                    "style-loader",
                    process.env.NODE_ENV==="production"
                        ? "css-loader?minimize&modules&importLoaders=1&localIdentName=[local]-[hash:base64:5]!postcss-loader"
                        : "css-loader?modules&importLoaders=1&localIdentName=[local]-[hash:base64:5]!postcss-loader"
                )
            },

            {
                test : /\.js$/,
                loaders: [ 'happypack/loader' ] // replaced... loader  : 'babel-loader'
            },

            {
                test : /\.json$/,
                loader  : 'json-loader'
            },

            {
                test: /\.(png|jpe?g|gif|svg|mp3|mpe?g)$/,
                loader: "file-loader?name=static/assets/[name]-[hash:2].[ext]"
            }

        ]

    },

    plugins: [
        new ExtractTextPlugin("app.css"),
        new webpack.DefinePlugin({
            'process.env.NODE_ENV': `"${process.env.NODE_ENV||"production"}"`
        }),
        new HappyPack({
            // loaders is the only required parameter:
            loaders: [ 'babel?presets[]=es2015' ]

            // customize as needed, see Configuration below
        }),
    ],


    cssLoader: {
        modules: true
    },

    postcss : [
        cssimport({ path: `${__dirname}/src/app` }),
        cssnext()
    ]
};

@@ -1465,161 +1465,28 @@
     
-// loaders is the only required parameter:%0A            loaders: %5B 'babel?presets%5B%5D=es2015' %5D%0A%0A            // customize as needed, see Configuration below
+loaders: %5B 'babel' %5D
 %0A   

Update happypack to use .babelrc config