-
Notifications
You must be signed in to change notification settings - Fork 89
Expand file tree
/
Copy pathwebpack.config.js
More file actions
34 lines (30 loc) · 1.08 KB
/
webpack.config.js
File metadata and controls
34 lines (30 loc) · 1.08 KB
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
'use strict';
const { merge } = require('webpack-merge');
const path = require('path');
const { WebpackDependenciesPlugin } = require('@mongodb-js/sbom-tools');
const baseWebpackConfig = require('../../config/webpack.base.config');
const webpackDependenciesPlugin = new WebpackDependenciesPlugin({
outputFilename: path.resolve(__dirname, '.sbom', 'dependencies.json'),
includeExternalProductionDependencies: true,
});
/** @type import('webpack').Configuration */
const config = {
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js',
libraryTarget: 'umd',
},
plugins: [webpackDependenciesPlugin],
externals: {
'mongodb-client-encryption': 'commonjs2 mongodb-client-encryption',
kerberos: 'commonjs2 kerberos',
snappy: 'commonjs2 snappy',
interruptor: 'commonjs2 interruptor',
'os-dns-native': 'commonjs2 os-dns-native',
'system-ca': 'commonjs2 system-ca',
},
};
module.exports = ['index', 'worker-runtime'].map((entry) => ({
entry: { [entry]: path.resolve(__dirname, 'src', `${entry}.ts`) },
...merge(baseWebpackConfig, config),
}));