const isProduction = process.env.NODE_ENV === 'production';

const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const webpack = require('webpack');

// EXTRACT APP ENTRY SASS TO CSS
const extractAppCss = new ExtractTextPlugin({
    filename: '[name].bundle.css',
    disable: !isProduction
});

module.exports = {
    entry: {
        app: './app.js'
    },

    output: {
        filename: '[name].bundle.js',
        path: path.resolve(__dirname, 'dist'),
        publicPath: '/'
    },

    context: path.resolve(__dirname, 'src'),

    module: {
        rules: [
            {
                test: /\.jsx?$/,
                exclude: /node_modules/,
                use: {
                    loader: 'babel-loader',
                    options: {
                        presets: [['env', {modules: false}], 'stage-3'],
                        plugins: ['transform-runtime', 'check-es2015-constants']
                    }
                }
            },
            {
                test: /\.sass$/,
                use: isProduction ? extractAppCss.extract({
                    fallback: 'style-loader',
                    use: ['css-loader', 'sass-loader']
                }) : ['style-loader', 'css-loader', 'sass-loader']
            },
            {
                test: /\.pug$/,
                use: ['html-loader', 'pug-html-loader']
            },
            {
                test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
                loader: 'file-loader'
            }
        ]
    },

    plugins: [
        new HtmlWebpackPlugin({
            template: 'app.pug',
            filename: 'app.html'
        }),
        extractAppCss,
        new webpack.HotModuleReplacementPlugin(),
        new webpack.NamedModulesPlugin(),
    ],

    devServer: {
        publicPath: '/',
        hot: false,
        contentBase: path.join(__dirname, 'dist')
    }
}

@@ -1,65 +1,4 @@
-const isProduction = process.env.NODE_ENV === 'production';%0A%0A
 cons
@@ -150,190 +150,8 @@
 n');
-%0Aconst webpack = require('webpack');%0A%0A// EXTRACT APP ENTRY SASS TO CSS%0Aconst extractAppCss = new ExtractTextPlugin(%7B%0A    filename: '%5Bname%5D.bundle.css',%0A    disable: !isProduction%0A%7D);
 %0A%0Amo
@@ -887,36 +887,25 @@
 se: 
-isProduction ? extractAppCss
+ExtractTextPlugin
 .ext
@@ -1034,56 +1034,8 @@
   %7D)
- : %5B'style-loader', 'css-loader', 'sass-loader'%5D
 %0A   
@@ -1449,114 +1449,85 @@
     
-e
+new E
 xtract
-AppCss,%0A        new webpack.HotModuleReplacementPlugin(),%0A        new webpack.NamedModulesPlugin(),
+TextPlugin(%7B%0A            filename: '%5Bname%5D.bundle.css',%0A        %7D)
 %0A   
@@ -1577,28 +1577,8 @@
 /',%0A
-        hot: false,%0A
     

Change webpack config to make it more simple