var path = require('path');
var serverlessWebpack = require('serverless-webpack')
var webpackNodeExternals = require('webpack-node-externals')

module.exports = {
  entry: serverlessWebpack.lib.entries,
  target: 'node',
  module: {
    loaders: [
      { test: /\.ts(x?)$/, loader: 'ts-loader' }
    ]
  },
  externals: [webpackNodeExternals()],
  resolve: {
    extensions: ['.ts', '.js', '.tsx', '.jsx']
  },
  output: {
    libraryTarget: 'commonjs',
    path: path.join(__dirname, '.webpack'),
    filename: 'handler.js'
  },
};


