Skip to content

Commit 79c69ae

Browse files
authored
chore(webpack, gen-ai): build provider.js with other assets; user args.entry when building a webpack config options (#5513)
1 parent 2d65208 commit 79c69ae

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

configs/webpack-config-compass/src/args.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export function webpackArgsWithDefaults(
5858

5959
return merge<ConfigArgs>(
6060
{
61-
entry: path.join(cwd, 'src', 'index.js'),
61+
entry: args.entry ?? path.join(cwd, 'src', 'index.js'),
6262
env: {},
6363
nodeEnv: process.env.NODE_ENV ?? args.mode ?? 'production',
6464
outputPath: path.join(cwd, 'dist'),
Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,15 @@
1-
const { compassPluginConfig } = require('@mongodb-js/webpack-config-compass');
2-
module.exports = compassPluginConfig;
1+
const path = require('path');
2+
const {
3+
compassPluginConfig,
4+
createWebConfig,
5+
} = require('@mongodb-js/webpack-config-compass');
6+
7+
module.exports = (env, args) => {
8+
return [
9+
...compassPluginConfig(env, args),
10+
createWebConfig({
11+
entry: path.resolve(__dirname, 'src', 'provider.tsx'),
12+
library: 'CompassGenerativeAiProvider',
13+
}),
14+
];
15+
};

0 commit comments

Comments
 (0)