From 11722e330362a2fe8af41fd6fa154d87142130c3 Mon Sep 17 00:00:00 2001 From: Sukairo-02 Date: Wed, 15 May 2024 14:37:39 +0300 Subject: [PATCH] Build fix --- .gitignore | 3 ++- Readme.md => README.md | 0 package.json | 17 ++++++++++++++--- scripts/build.ts | 3 +-- 4 files changed, 17 insertions(+), 6 deletions(-) rename Readme.md => README.md (100%) diff --git a/.gitignore b/.gitignore index 76add87..85c59aa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules -dist \ No newline at end of file +dist +package.tgz \ No newline at end of file diff --git a/Readme.md b/README.md similarity index 100% rename from Readme.md rename to README.md diff --git a/package.json b/package.json index c23fd7b..6425392 100755 --- a/package.json +++ b/package.json @@ -40,9 +40,20 @@ "ts", "schema" ], - "main": "./index.cjs", - "module": "./index.js", - "types": "./index.d.ts", + "exports": { + ".": { + "import": { + "types": "./index.d.ts", + "default": "./index.js" + }, + "require": { + "types": "./index.d.cjs", + "default": "./index.cjs" + }, + "types": "./index.d.ts", + "default": "./index.js" + } + }, "sideEffects": false, "publishConfig": { "provenance": true diff --git a/scripts/build.ts b/scripts/build.ts index a7992b8..b25f645 100644 --- a/scripts/build.ts +++ b/scripts/build.ts @@ -10,7 +10,6 @@ await build({ sourcemap: true, dts: true, format: ['cjs', 'esm'], - external: ['drizzle-kit', '../drizzle-kit', '../drizzle-kit/**'], outExtension(ctx) { if (ctx.format === 'cjs') { return { @@ -26,4 +25,4 @@ await build({ }); fs.copyFileSync('package.json', 'dist/package.json'); -// fs.copyFileSync('README.md', 'dist/README.md'); +fs.copyFileSync('README.md', 'dist/README.md');