diff --git a/.changeset/eighty-tomatoes-greet.md b/.changeset/eighty-tomatoes-greet.md new file mode 100644 index 0000000..ce87050 --- /dev/null +++ b/.changeset/eighty-tomatoes-greet.md @@ -0,0 +1,5 @@ +--- +'@codota/token.js': minor +--- + +esm build diff --git a/package.json b/package.json index a9fe07c..98e896f 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ }, "packageManager": "pnpm@8.6.12", "description": "Integrate 9 LLM providers with a single Typescript SDK using OpenAIs format.", - "main": "dist/index.cjs", + "main": "dist/index.js", "types": "dist/index.d.ts", "type": "module", "files": [ diff --git a/scripts/build.ts b/scripts/build.ts index 9e74d5b..bcc17d5 100644 --- a/scripts/build.ts +++ b/scripts/build.ts @@ -7,8 +7,8 @@ const build = async () => { entryPoints: ['src/index.ts'], bundle: true, minify: true, - format: 'cjs', - outfile: `./dist/index.cjs`, + format: 'esm', + outfile: `./dist/index.js`, platform: 'node', treeShaking: true, tsconfig: 'tsconfig.json', diff --git a/tsconfig.json b/tsconfig.json index 1b8fee4..631b0a6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,7 +16,7 @@ "rootDir": "./src", "skipLibCheck": true, "sourceMap": true, - "target": "ES2015", + "target": "ES2020", "typeRoots": [ "node_modules/@types" ]