@@ -16,8 +16,8 @@ export default defineConfig(({ mode }) => {
1616 minify : ! isCJSBuild ,
1717 sourcemap : true ,
1818 // UMD build should target the lowest level ES,
19- // while CJS the lowest Node.js LTS compatible version
20- target : isCJSBuild ? "es2022 " : "es6" ,
19+ // while CJS the lowest Node.js LTS compatible version (https://node.green/#ES2023)
20+ target : isCJSBuild ? "es2023 " : "es6" ,
2121 lib : {
2222 // leave out token export from UMD build
2323 entry : isCJSBuild ? [ indexInput , tokenInput ] : indexInput ,
@@ -34,12 +34,8 @@ export default defineConfig(({ mode }) => {
3434 }
3535 } ,
3636 } ,
37- rollupOptions : isCJSBuild
38- ? {
39- // make sure external imports that should not be bundled are listed here for CJS build
40- external : [ "node:crypto" ] ,
41- }
42- : // the following code enables Vite in UMD mode to extend the global object with all of
37+ rollupOptions : ! isCJSBuild
38+ ? // the following code enables Vite in UMD mode to extend the global object with all of
4339 // the exports, and not just a property of it ( https://github.com/vitejs/vite/issues/11624 )
4440 // TODO: Remove this in the future ( https://github.com/meilisearch/meilisearch-js/issues/1806 )
4541 {
@@ -52,7 +48,8 @@ export default defineConfig(({ mode }) => {
5248 }
5349 })();` ,
5450 } ,
55- } ,
51+ }
52+ : undefined ,
5653 } ,
5754 test : {
5855 include : [ "tests/**/*.test.ts" ] ,
0 commit comments