-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.config.js
45 lines (35 loc) · 1.16 KB
/
webpack.config.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
// This webpack config is only used for compiling the external scripts. For the
// NextJS specific webpack configs, check config/next.config.ts
// ? Running an environment check first just to make sure everything is okay...
require('./src/dev-utils').populateEnv();
const DotenvPlugin = require('dotenv-webpack');
process.env.NODE_ENV = 'external';
module.exports = {
mode: 'production',
target: 'node',
entry: {
'ban-hammer': `${__dirname}/external-scripts/ban-hammer.ts`,
'prune-logs': `${__dirname}/external-scripts/prune-logs.ts`,
'generate-flights': `${__dirname}/external-scripts/generate-flights.ts`,
},
output: {
filename: '[name].js',
path: `${__dirname}/external-scripts/bin`
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.json'],
alias: {
universe: `${__dirname}/src/`,
multiverse: `${__dirname}/lib/`
}
},
module: {
rules: [{ test: /\.(ts|js)x?$/, loader: 'babel-loader', exclude: /node_modules/ }],
},
stats: {
warningsFilter: [/critical dependency:/i],
},
plugins: [
new DotenvPlugin()
]
};