Skip to content

Instantly share code, notes, and snippets.

@harshq
Created June 6, 2021 09:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harshq/df1e25b12de12365d03da5c18d754480 to your computer and use it in GitHub Desktop.
Save harshq/df1e25b12de12365d03da5c18d754480 to your computer and use it in GitHub Desktop.
serverless-webpack config
const path = require('path');
const slsw = require('serverless-webpack');
module.exports = {
mode: slsw.lib.webpack.isLocal ? 'development' : 'production',
entry: slsw.lib.entries,
stats: 'summary',
resolve: {
extensions: ['.ts'],
},
target: 'node',
module: {
rules: [
{
test: /\.(ts?)$/,
loader: 'ts-loader',
exclude: [
[
path.resolve(__dirname, 'node_modules'),
path.resolve(__dirname, '.serverless'),
path.resolve(__dirname, '.webpack'),
],
],
},
],
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment