-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
46 lines (37 loc) · 932 Bytes
/
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
46
const path = require('path');
const nodeExternals = require('webpack-node-externals');
const srcPath = subDir => path.join(__dirname, "src", subDir);
module.exports = {
entry: './src/server.ts',
devtool: 'inline-source-map',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
},
resolve: {
extensions: ['.ts', '.js', '.json'],
alias: {
constants: srcPath('constants'),
controllers: srcPath('controllers'),
middleware: srcPath('middleware'),
migration: srcPath('migration'),
models: srcPath('models'),
subscriber: srcPath('subscriber'),
utils: srcPath('utils'),
src: srcPath('')
},
modules: ['node_modules']
},
module: {
rules: [
{
use: 'ts-loader',
test: /\.ts?$/,
exclude: /node_modules/
}
]
},
externals: [nodeExternals()],
target: 'node',
mode: 'development'
};