-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
30 lines (27 loc) · 872 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
import path from 'path'
// import nodeExternals from 'webpack-node-externals'
// Path CONST
const PROJECT_ROOT = process.cwd()
const { NODE_ENV = 'production' } = process.env
export default {
entry: './src/api/app.js',
mode: NODE_ENV,
target: 'node',
node: {
global: false,
__filename: false,
__dirname: false
},
output: {
path: path.resolve(PROJECT_ROOT, 'dist', 'server'),
filename: 'app.cjs'
},
resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx']
},
externals: {
'node-pty': 'commonjs2 node-pty'
}
// externalsPresets: { node: true } // in order to ignore built-in modules like path, fs, etc.
// externals: [nodeExternals({ allowlist: ['lowdb'] })] // in order to ignore all modules in node_modules folder, except 'lowdb' (lowdb can only be used as esm)
}