-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.local.config.js
42 lines (41 loc) · 983 Bytes
/
webpack.local.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
/* eslint-disable @typescript-eslint/no-var-requires */
const path = require('path');
const nodeExternals = require('webpack-node-externals');
module.exports = {
// CUSTOMIZE HERE
entry: {
server: './apps/api/src/main.ts',
},
output: {
path: path.join(__dirname, 'dist'),
filename: '[name].js',
},
optimization: {
minimize: true,
nodeEnv: 'local',
},
// JUST KEEP THEM
externals: [nodeExternals()],
mode: 'production',
target: 'node',
module: {
rules: [
{
test: /\.ts$/,
exclude: [/node_modules/, /test/],
options: {
configFile: 'apps/api/tsconfig.app.json',
},
loader: 'ts-loader',
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
alias: {
'@api': path.resolve(__dirname, 'apps/api/src'),
'@common/configs': path.resolve(__dirname, 'libs/configs/src'),
'@common/prisma': path.resolve(__dirname, 'libs/prisma/src'),
},
},
};