Created
December 17, 2017 02:51
-
-
Save lucasklaassen/7c18b28d8c4d692db439ca367e973db0 to your computer and use it in GitHub Desktop.
serverless-webpack configuration for debugging
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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