Skip to content

Commit

Permalink
fix(chromadb): use rollup (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
nirga authored May 6, 2024
1 parent 749afb6 commit b7566bf
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/instrumentation-chromadb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"types": "dist/src/index.d.ts",
"repository": "traceloop/openllmetry-js",
"scripts": {
"build": "tsc --build tsconfig.json",
"build": "rollup -c",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
"test": "ts-mocha -p tsconfig.json 'tests/**/*.test.ts' --timeout 20000"
Expand Down
37 changes: 37 additions & 0 deletions packages/instrumentation-chromadb/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
const dts = require("rollup-plugin-dts");
const typescript = require("@rollup/plugin-typescript");
const json = require("@rollup/plugin-json");

// eslint-disable-next-line @typescript-eslint/no-var-requires
const name = require("./package.json").main.replace(/\.js$/, "");

const bundle = (config) => ({
...config,
input: "src/index.ts",
external: (id) => !/^[./]/.test(id),
});

exports.default = [
bundle({
plugins: [typescript.default(), json.default()],
output: [
{
file: `${name}.js`,
format: "cjs",
sourcemap: true,
},
{
file: `${name}.mjs`,
format: "es",
sourcemap: true,
},
],
}),
bundle({
plugins: [dts.default()],
output: {
file: `${name}.d.ts`,
format: "es",
},
}),
];

0 comments on commit b7566bf

Please sign in to comment.