Skip to content

Commit b7566bf

Browse files
authored
fix(chromadb): use rollup (#247)
1 parent 749afb6 commit b7566bf

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

packages/instrumentation-chromadb/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"types": "dist/src/index.d.ts",
77
"repository": "traceloop/openllmetry-js",
88
"scripts": {
9-
"build": "tsc --build tsconfig.json",
9+
"build": "rollup -c",
1010
"lint": "eslint . --ext .ts",
1111
"lint:fix": "eslint . --ext .ts --fix",
1212
"test": "ts-mocha -p tsconfig.json 'tests/**/*.test.ts' --timeout 20000"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
const dts = require("rollup-plugin-dts");
2+
const typescript = require("@rollup/plugin-typescript");
3+
const json = require("@rollup/plugin-json");
4+
5+
// eslint-disable-next-line @typescript-eslint/no-var-requires
6+
const name = require("./package.json").main.replace(/\.js$/, "");
7+
8+
const bundle = (config) => ({
9+
...config,
10+
input: "src/index.ts",
11+
external: (id) => !/^[./]/.test(id),
12+
});
13+
14+
exports.default = [
15+
bundle({
16+
plugins: [typescript.default(), json.default()],
17+
output: [
18+
{
19+
file: `${name}.js`,
20+
format: "cjs",
21+
sourcemap: true,
22+
},
23+
{
24+
file: `${name}.mjs`,
25+
format: "es",
26+
sourcemap: true,
27+
},
28+
],
29+
}),
30+
bundle({
31+
plugins: [dts.default()],
32+
output: {
33+
file: `${name}.d.ts`,
34+
format: "es",
35+
},
36+
}),
37+
];

0 commit comments

Comments
 (0)