Created
June 25, 2019 11:28
-
-
Save supachris28/994fee06c48e627a1424eeeea849f216 to your computer and use it in GitHub Desktop.
This file contains 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 slsw = require('serverless-webpack'); | |
const path = require('path'); | |
const nodeExternals = require('webpack-node-externals'); | |
module.exports = { | |
entry: slsw.lib.entries, // important | |
target: 'node', | |
mode: 'production', | |
devtool: 'source-map', // important | |
externals: [nodeExternals()], | |
module: { | |
rules: [ | |
{ | |
test: /\.js$/, | |
exclude: /node_modules/, | |
use: [ | |
{ | |
loader: 'babel-loader', | |
}, | |
], | |
}, | |
], | |
}, | |
output: { // important | |
libraryTarget: 'commonjs', | |
path: path.join(__dirname, '.webpack'), | |
filename: '[name].js', | |
sourceMapFilename: '[file].map', | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment