-
Notifications
You must be signed in to change notification settings - Fork 47
/
webpack.config.lambda.js
56 lines (55 loc) · 1.36 KB
/
webpack.config.lambda.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
const CopyPlugin = require('copy-webpack-plugin');
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
module.exports = {
externals: {
'@sparticuz/chromium': 'commonjs @sparticuz/chromium',
'aws-crt': 'commonjs aws-crt',
'puppeteer-core': 'commonjs puppeteer-core',
},
mode: 'production',
module: {
rules: [
{
exclude: /node_modules/,
// eslint-disable-next-line
test: /\.(jsx)$/,
use: ['babel-loader'],
},
{
// eslint-disable-next-line
test: /\.(map|node)$/,
use: ['file-loader'],
},
{
exclude: /node_modules/,
// eslint-disable-next-line
test: /\.tsx?$/,
use: [
{
loader: 'ts-loader',
options: {
transpileOnly: true,
},
},
],
},
],
},
optimization: {
minimize: false,
},
plugins: [
new CopyPlugin({
patterns: [
{ from: 'node_modules/pdfjs-dist/legacy/build', to: '.' },
{ from: 'node_modules/pdf-lib/dist', to: '.' },
{ from: 'shared/static/pdfs/amended-petition-form.pdf', to: '.' },
],
}),
],
resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
plugins: [new TsconfigPathsPlugin()], // Allows us to use the tsconfig path alias + basePath
},
target: 'node',
};