const webpack = require('webpack');

module.exports = {
  entry: {
    ContentSelectionText: './src/ContentSelectionText.js',
    Popup: './src/Popup.js',
    Background: './src/Background.js',
  },
  output: {
    path: './_build/extension/',
    filename: '[name].bundle.js',
  },
  module: {
    loaders: [
      {
        test: /\.js$/,
        exclude: /(node_modules|_build)/,
        loader: 'babel-loader',
        query: {
          presets: ['latest', 'react', 'stage-0']
        }
      },
      {
        test: /\.(png|jpg|gif|json|html|css)$/,
        loader: 'file-loader?name=[name].[ext]'
      }
    ],
  },
  plugins: [
    // new webpack.DefinePlugin({
    //   'process.env':{
    //     'NODE_ENV': JSON.stringify('production')
    //   }
    // }),
    // new webpack.optimize.UglifyJsPlugin({
    //   exclude: /(_build)/,
    // })
  ],
};

const webpack = require('webpack');

module.exports = {
  entry: {
    ContentSelectionText: './src/ContentSelectionText.js',
    Popup: './src/Popup.js',
    Background: './src/Background.js',
  },
  output: {
    path: './_build/extension/',
    filename: '[name].bundle.js',
  },
  module: {
    loaders: [
      {
        test: /\.js$/,
        exclude: /(node_modules|_build)/,
        loader: 'babel-loader',
        query: {
          presets: ['latest', 'react', 'stage-0']
        }
      },
      {
        test: /\.(png|jpg|gif|json|html|css)$/,
        loader: 'file-loader?name=[name].[ext]'
      }
    ],
  },
  plugins: [
    // new webpack.DefinePlugin({
    //   'process.env':{
    //     'NODE_ENV': JSON.stringify('production')
    //   }
    // }),
    // new webpack.optimize.UglifyJsPlugin({
    //   // running uglify over pre-optimized jsoo code adds octal literals
    //   // which are deprecated in FF.
    //   exclude: /(_build|Background.js)/,
    // })
  ],
};

exclude Background.js from optimization until we can optimize for strict more in FF safely