forked from DefiLlama/yield-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
31 lines (30 loc) · 849 Bytes
/
webpack.config.js
File metadata and controls
31 lines (30 loc) · 849 Bytes
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
const slsw = require('serverless-webpack');
const path = require('path');
const webpack = require('webpack');
module.exports = {
entry: slsw.lib.entries,
target: 'node',
mode: slsw.lib.webpack.isLocal ? 'development' : 'production',
module: {
rules: [
{
test: /\.(ts|js)$/,
use: { loader: 'babel-loader' },
include: path.resolve(__dirname, 'src'),
exclude: /node_modules/,
},
],
},
resolve: {
mainFields: ['main'],
extensions: ['.js', '.ts', '.json'],
alias: {
'bignumber.js$': 'bignumber.js/bignumber.js',
'node-fetch$': 'node-fetch/lib/index.js',
},
},
plugins: [
// pg optionally requires pg-native; ignore it -> webpack doesn't fail when the native addon isn't installed
new webpack.IgnorePlugin({ resourceRegExp: /^pg-native$/ }),
],
};