import * as path from 'path'; import * as webpack from 'webpack'; import * as nodeExternals from 'webpack-node-externals'; export const config: webpack.Configuration = { entry: path.resolve(__dirname, '../../index.ts'), externals: nodeExternals(), module: { rules: [ { test: /\.tsx?$/, use: [ { loader: 'awesome-typescript-loader' } ] } ] }, resolve: { extensions: [ '.js', '.ts' ], // Fix webpack's default behavior to not load packages with jsnext:main module // (jsnext:main directs not usually distributable es6 format, but es6 sources) mainFields: [ 'module', 'browser', 'main' ] }, target:'node' };