Skip to content

Instantly share code, notes, and snippets.

@lucasklaassen
Created December 17, 2017 02:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucasklaassen/7c18b28d8c4d692db439ca367e973db0 to your computer and use it in GitHub Desktop.
Save lucasklaassen/7c18b28d8c4d692db439ca367e973db0 to your computer and use it in GitHub Desktop.
serverless-webpack configuration for debugging
const nodeExternals = require('webpack-node-externals');
const path = require('path');
const slsw = require('serverless-webpack');
module.exports = {
devtool: 'source-map',
entry: slsw.lib.entries,
target: 'node',
externals: [nodeExternals()],
output: {
libraryTarget: 'commonjs',
path: path.resolve(__dirname, '.webpack'),
filename: '[name].js' // this should match the first part of function handler in serverless.yml
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
loaders: ["babel-loader"]
},
{
test: /\.json$/,
loader: 'json-loader'
}
]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment