/*
 * Webpack distribution configuration
 *
 * This file is set up for serving the distribution version. It will be compiled to dist/ by default
 */

var webpack = require('webpack'),
    path = require('path');
var eslintrcPath = path.resolve(__dirname, '.eslintrc');

module.exports = {
  devtool: false,
  output: {
    publicPath: './',
    path: 'dist/',
    filename: 'main.js',
    library: 'SmartBanner',
    libraryTarget: 'umd'
  },

  entry: {
    main: './src/components/SmartBanner.js'
  },

  externals: {
    'react': {
      root: 'React',
      commonjs2: 'react',
      commonjs: 'react',
      amd: 'react'
    },
    'react-dom': {
      root: 'ReactDOM',
      commonjs2: 'react-dom',
      commonjs: 'react-dom',
      amd: 'react-dom'
    }
  },

  stats: {
    colors: true,
    reasons: false
  },

  stats: {
    colors: true,
    reasons: false
  },

  plugins: [
    new webpack.DefinePlugin({
      'process.env': {
        'NODE_ENV': JSON.stringify('production')
      }
    }),
    new webpack.optimize.DedupePlugin(),
    new webpack.optimize.UglifyJsPlugin({
      compress: {
        warnings: false
      }
    }),
    new webpack.optimize.OccurenceOrderPlugin(),
    new webpack.optimize.AggressiveMergingPlugin()
  ],

  resolve: {
    extensions: ['', '.js'],
    alias: {
      'styles': __dirname + '/src/styles',
      'mixins': __dirname + '/src/mixins',
      'components': __dirname + '/src/components/'
    }
  },

  module: {
    loaders: [{
      test: /\.js$/,
      exclude: /node_modules/,
      loader: 'uglify!babel'
    }, {
      test: /\.css$/,
      loader: 'style!css'
    }, {
      test: /\.scss/,
      loader: 'style!css!sass?outputStyle=expanded'
    }, {
      test: /\.(png|jpg|woff|woff2)$/,
      loader: 'url?limit=8192'
    }]
  },

  eslint: {
    configFile: eslintrcPath
  }
};

@@ -261,16 +261,80 @@
 intrc');
+%0Avar ExtractTextPlugin = require('extract-text-webpack-plugin');
 %0A%0Amodule
@@ -1655,12 +1655,12 @@
  /%5C.
+s
 css
-$
 /,%0A 
@@ -1676,72 +1676,44 @@
 er: 
-'style!css'%0A    %7D, %7B%0A      test: /%5C.scss/,%0A      loader: 
+ExtractTextPlugin.extract(
 'style
-!
+', '
 css!
@@ -1742,87 +1742,9 @@
 ded'
-%0A    %7D, %7B%0A      test: /%5C.(png%7Cjpg%7Cwoff%7Cwoff2)$/,%0A      loader: 'url?limit=8192'
+)
 %0A   

Output css setting