This repository has been archived by the owner on Nov 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.test.js
79 lines (77 loc) · 2.11 KB
/
config.test.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
const path = require("path");
const webpack = require("webpack");
const nodeExternals = require("webpack-node-externals");
require("dotenv").config();
const envs = {
NODE_ENV: JSON.stringify("testing"),
TEST_USERNAME: JSON.stringify(process.env.TEST_USERNAME),
TEST_PASSWORD: JSON.stringify(process.env.TEST_PASSWORD),
PAYSTACK_SECRET: JSON.stringify(process.env.PAYSTACK_SECRET),
PAYSTACK_PUBLIC_KEY: JSON.stringify(process.env.PAYSTACK_PUBLIC_KEY),
COGNITO_AUD: JSON.stringify(process.env.COGNITO_AUD),
COGNITO_USER_POOL_ID: JSON.stringify(process.env.COGNITO_USER_POOL_ID),
ZOHO_EMAIL: JSON.stringify(process.env.ZOHO_EMAIL),
ZOHO_PASSWORD: JSON.stringify(process.env.ZOHO_PASSWORD),
DB_USER: JSON.stringify(process.env.DB_USER),
DB_PASSWORD: JSON.stringify(process.env.DB_PASSWORD),
JWT_SECRET: JSON.stringify(process.env.JWT_SECRET),
ACCESS_KEY_ID: JSON.stringify(process.env.ACCESS_KEY_ID),
SECRET_KEY: JSON.stringify(process.env.SECRET_KEY)
};
module.exports = {
target: "node",
mode: "none",
output: {
devtoolModuleFilenameTemplate: "[absolute-resource-path]",
devtoolFallbackModuleFilenameTemplate: "[absolute-resource-path]?[hash]"
},
devtool: "cheap-module-source-map",
externals: [nodeExternals()],
module: {
rules: [
{
test: /\.(js|ts)/,
include: path.resolve("src"), // instrument only testing sources with Istanbul, after ts-loader runs
loader: "istanbul-instrumenter-loader",
query: {
esModules: true
}
},
{
test: /\.js?$/,
use: [
{
loader: "babel-loader",
options: {
babelrc: false,
presets: [
["@babel/preset-env", { modules: "auto" }],
"@babel/preset-react",
"@babel/preset-flow"
],
plugins: [
"transform-regenerator",
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-transform-runtime",
"transform-class-properties"
]
}
}
],
exclude: /node_modules/
},
{
test: /\.html$/,
exclude: /node_modules/,
use: {
loader: "raw-loader"
}
}
]
},
plugins: [
new webpack.DefinePlugin({
"process.env": envs
})
]
};