var fs = require('fs-extra');
var path = require('path');
var chalk = require('chalk');
var webpack = require('webpack');
var objectAssign = require('object-assign');

var paths = require('./paths');
var babelConfig = require('./babel');

var isDevelopment = process.env.NODE_ENV !== 'production';

babelConfig = objectAssign(babelConfig, {
  cacheDirectory: isDevelopment,
});

module.exports = {
  entry: paths.entry,
  output: {
    path: paths.build,
    filename: 'plugin.js',
    library: 'handlers',
    libraryTarget: 'var'
  },
  module: {
    loaders: [
      {
        test: /\.(js|jsx)$/,
        include: paths.src,
        exclude: /(node_modules)/,
        use: {
          loader: 'babel-loader',
          options: babelConfig
        }
      }
    ]
  }
}

@@ -365,17 +365,16 @@
 elopment
-,
 %0A%7D);%0A%0Amo
@@ -763,11 +763,121 @@
    %5D%0A  %7D
+,%0A  plugins: %5B%0A    new webpack.IgnorePlugin(/%5Esketch%5C/%5Ba-z%5D+$/),%0A    new webpack.IgnorePlugin(/%5Esketch$/)%0A  %5D
 %0A%7D
+;
 %0A

Add webpack ignore plugin to allow requires for new Sketch API