Last active
June 20, 2019 12:36
-
-
Save john-e/8b9caf84072675deb63296f967d21f79 to your computer and use it in GitHub Desktop.
Webpack config for bundling lambdas in production
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 path = require('path'); | |
| const webpack = require('webpack'); | |
| module.exports = { | |
| entry: './src/index.ts', | |
| module: { | |
| rules: [ | |
| { | |
| test: /\.tsx?$/, | |
| use: 'ts-loader', | |
| exclude: /node_modules/, | |
| }, | |
| ], | |
| }, | |
| resolve: { | |
| extensions: ['.tsx', '.ts', '.js'], | |
| }, | |
| plugins: [ | |
| // ignore optional dependencies | |
| new webpack.IgnorePlugin(/^redis$/), | |
| ], | |
| output: { | |
| filename: 'index.js', | |
| path: path.resolve(__dirname, './release'), | |
| libraryTarget: 'umd', | |
| }, | |
| target: 'async-node', | |
| mode: 'production', | |
| externals: [], | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment