-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
32 lines (29 loc) · 887 Bytes
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
var path = require('path');
var slsw = require('serverless-webpack');
var nodeExternals = require('webpack-node-externals');
// Add error handling and source map support
var entries = Object.keys(slsw.lib.entries).reduce(function(acc, key) {
acc[key] = ["./_webpack/include.js", slsw.lib.entries[key]];
return acc;
}, {});
console.log(__dirname);
module.exports = {
entry: entries,
target: 'node',
// Generate sourcemaps for proper error messages
devtool: 'source-map',
// Since 'aws-sdk' is not compatible with webpack,
// we exclude all node dependencies
externals: [nodeExternals({
whitelist: [ 'kraken-api' ]
})],
// Run babel on all .js files and skip those in node_modules
module: {
rules: [{
test: /\.js$/,
loader: 'babel-loader',
include: __dirname,
exclude: /node_modules\/(?!(kraken-api)\/).*/,
}]
}
};