forked from homebridge/homebridge-config-ui-x
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
53 lines (48 loc) · 1.34 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
46
47
48
49
50
51
52
53
/* eslint-disable @typescript-eslint/no-var-requires */
const path = require('node:path')
const webpack = require('webpack')
const packageJson = require('./package.json')
const externals = {}
for (const dep of Object.keys(packageJson.dependencies)) {
externals[dep] = dep
}
module.exports = {
entry: {
server: './src/main.ts',
},
output: {
filename: 'main.js',
path: path.join(__dirname, 'dist'),
libraryTarget: 'commonjs',
},
target: 'node',
mode: 'production',
externals,
node: {
global: false,
__filename: false,
__dirname: false,
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
module: {
rules: [
{
test: /.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
],
},
optimization: {
minimize: false,
},
plugins: [
new webpack.IgnorePlugin({ resourceRegExp: /^\.\/locale$/, contextRegExp: /@nestjs\/microservices/ }),
new webpack.IgnorePlugin({ resourceRegExp: /^\.\/locale$/, contextRegExp: /@nestjs\/platform-express/ }),
new webpack.IgnorePlugin({ resourceRegExp: /^\.\/locale$/, contextRegExp: /swagger-ui-express/ }),
new webpack.IgnorePlugin({ resourceRegExp: /^\.\/locale$/, contextRegExp: /cache-manager/ }),
new webpack.IgnorePlugin({ resourceRegExp: /^\.\/locale$/, contextRegExp: /osx-temperature-sensor/ }),
],
}