Skip to content

Commit 17212ab

Browse files
author
Piotr Paulski
committed
Externalize bidi, fix THIRD_PARTY_NOTICES generation.
1 parent 1bdd582 commit 17212ab

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

rollup.config.mjs

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,17 @@ const allowedLicenses = [
3939
'0BSD',
4040
];
4141

42-
/** @returns {import('rollup').RollupOptions} */
43-
const bundleDependency = (wrapperIndexPath, extraOutputOptions = {}) => ({
42+
/**
43+
* @param {string} wrapperIndexPath
44+
* @param {import('rollup').OutputOptions} [extraOutputOptions={}]
45+
* @param {string[]} [external=[]]
46+
* @returns {import('rollup').RollupOptions}
47+
*/
48+
const bundleDependency = (
49+
wrapperIndexPath,
50+
extraOutputOptions = {},
51+
external = []
52+
) => ({
4453
input: wrapperIndexPath,
4554
output: {
4655
...extraOutputOptions,
@@ -65,13 +74,7 @@ const bundleDependency = (wrapperIndexPath, extraOutputOptions = {}) => ({
6574
failOnViolation: true,
6675
},
6776
output: {
68-
file: path.join(
69-
'build',
70-
'src',
71-
'third_party',
72-
'modelcontextprotocol-sdk',
73-
'THIRD_PARTY_NOTICES',
74-
),
77+
file: path.join(path.dirname(wrapperIndexPath), 'THIRD_PARTY_NOTICES'),
7578
template(dependencies) {
7679
const stringified_dependencies = dependencies.map(dependency => {
7780
let arr = [];
@@ -100,11 +103,16 @@ const bundleDependency = (wrapperIndexPath, extraOutputOptions = {}) => ({
100103
json(),
101104
nodeResolve(),
102105
],
106+
external,
103107
});
104108

105109
export default [
106110
bundleDependency('./build/src/third_party/modelcontextprotocol-sdk/index.js'),
107-
bundleDependency('./build/src/third_party/puppeteer-core/index.js', {
108-
inlineDynamicImports: true,
109-
}),
111+
bundleDependency(
112+
'./build/src/third_party/puppeteer-core/index.js',
113+
{
114+
inlineDynamicImports: true,
115+
},
116+
['./bidi.js', '../bidi/bidi.js']
117+
),
110118
];

0 commit comments

Comments
 (0)