Skip to content

Instantly share code, notes, and snippets.

@andresmijares
Created March 11, 2019 02:01
Show Gist options
  • Save andresmijares/bae3b305134e90c96401e1f54a8c23e3 to your computer and use it in GitHub Desktop.
Save andresmijares/bae3b305134e90c96401e1f54a8c23e3 to your computer and use it in GitHub Desktop.
const path = require('path')
const slsw = require('serverless-webpack')
const nodeExternals = require('webpack-node-externals')
const webpack = require('webpack')
module.exports = {
entry: slsw.lib.entries,
target: 'node',
mode: slsw.lib.webpack.isLocal ? 'development' : 'production',
optimization: {
minimize: false
},
performance: {
hints: false
},
devtool: 'nosources-source-map',
externals: [
nodeExternals()
],
plugins: [
new webpack.IgnorePlugin(/^\/opt/)
],
output: {
libraryTarget: 'commonjs2',
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