import path from 'path'
import webpack from 'webpack'
import nodeExternals from 'webpack-node-externals'

const PRODUCTION = process.env.NODE_ENV === 'production'

export default {
  entry: path.resolve('src/index.js'),

  output: {
    path: path.resolve('lib'),
    filename: 'index.js',
    libraryTarget: 'commonjs2'
  },

  plugins: [
    new webpack.NoErrorsPlugin(),
    new webpack.DefinePlugin({
      NODE_ENV: JSON.stringify(process.env.NODE_ENV)
    })
  ],

  module: {
    loaders: [{
      test: /\.js$/,
      loader: 'babel',
      exclude: /node_modules/
    }, {
      test: /\.py$/,
      loader: 'raw'
    }, {
      test: /\.pegjs$/,
      loader: 'pegjs'
    }]
  },

  externals: [nodeExternals(), 'gdb-js'],

  postcss: () => [precss, autoprefixer],

  devtool: 'source-map'
}


@@ -103,66 +103,8 @@
 s'%0A%0A
-const PRODUCTION = process.env.NODE_ENV === 'production'%0A%0A
 expo
@@ -346,24 +346,50 @@
 %7B%0A      
+'process.env': %7B%0A        '
 NODE_ENV
 : JSON.s
@@ -380,16 +380,17 @@
 NODE_ENV
+'
 : JSON.s
@@ -420,16 +420,24 @@
 DE_ENV)%0A
+      %7D%0A
     %7D)%0A 
@@ -661,16 +661,16 @@
 %5D%0A  %7D,%0A%0A
+
   extern
@@ -694,60 +694,8 @@
 ls()
-, 'gdb-js'%5D,%0A%0A  postcss: () =%3E %5Bprecss, autoprefixer
 %5D,%0A%0A

fix build config