-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwebpack.config.ts
40 lines (38 loc) · 1.07 KB
/
webpack.config.ts
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
const path = require('path')
const webpack = require('webpack')
require('dotenv').config({ path: '.env' })
// Webpack config used to build the Autotasks
// TODO: Move this into seperate package to keep project root tidy
module.exports = (env) => ({
entry: `./services/oz-defender/autotasks/src/${env.TASK_NAME}/index.ts`,
target: 'node',
mode: 'development',
devtool: 'cheap-module-source-map',
module: {
rules: [{ test: /\.tsx?$/, use: 'ts-loader', exclude: /node_modules/ }]
},
resolve: {
extensions: ['.ts', '.js']
},
externals: [
// List here all dependencies available on the Autotask environment
/axios/,
/apollo-client/,
/defender-[^\-]+-client/,
/ethers/,
/web3/,
/@ethersproject\/.*/,
/aws-sdk/,
/aws-sdk\/.*/
],
externalsType: 'commonjs2',
plugins: [
// List here all dependencies that are not run in the Autotask environment
new webpack.IgnorePlugin({ resourceRegExp: /dotenv/ })
],
output: {
filename: `${env.TASK_NAME}/index.js`,
path: path.resolve(__dirname, './services/oz-defender/autotasks/dist'),
library: { type: 'commonjs2' }
}
})