Last active
January 21, 2019 13:58
-
-
Save gimdongwoo/de7ea69d0c5ec4026b9adaa21edff732 to your computer and use it in GitHub Desktop.
AWS Lambda
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
'use strict'; | |
const path = require('path'); | |
const webpack = require('webpack'); | |
const config = { | |
devtool: 'source-map', | |
entry: './src/index.ts', | |
output: { | |
path: path.resolve('./target'), | |
filename: 'index.js', | |
libraryTarget: 'commonjs2', | |
}, | |
target: 'node', | |
resolve: { | |
extensions: ['.json', '.tsx', '.ts', '.js'], | |
}, | |
externals: ['aws-sdk', 'ws', 'puppeteer'], | |
module: { | |
rules: [ | |
{ | |
test: /\.js?$/, | |
exclude: /node_modules/, | |
use: [ | |
{ | |
loader: 'babel-loader', | |
options: { | |
presets: [ | |
[ | |
'env', | |
{ | |
targets: { | |
node: '8.10', | |
}, | |
}, | |
], | |
], | |
cacheDirectory: true, | |
}, | |
}, | |
], | |
}, | |
{ | |
test: /\.ts?$/, | |
exclude: /node_modules/, | |
use: [ | |
{ | |
loader: 'ts-loader', | |
}, | |
], | |
}, | |
], | |
}, | |
plugins: [ | |
new webpack.NoEmitOnErrorsPlugin(), | |
new webpack.DefinePlugin({ | |
'process.env': { | |
NODE_ENV: JSON.stringify(process.env.NODE_ENV), | |
}, | |
}), | |
new webpack.LoaderOptionsPlugin({ | |
minimize: true, | |
debug: true, | |
}), | |
], | |
}; | |
module.exports = config; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment