From 99113bc5c4be5b21e37cc390018b3715523f1fcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C4=8Cerm=C3=A1k?= Date: Tue, 16 Apr 2024 15:48:37 +0200 Subject: [PATCH] :wrench: Update build config --- .gitignore | 3 ++- .npmignore | 3 +++ package.json | 6 +++--- tsconfig.json | 5 +++-- 4 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 .npmignore diff --git a/.gitignore b/.gitignore index 17df059..38e3edd 100644 --- a/.gitignore +++ b/.gitignore @@ -20,4 +20,5 @@ dist .cache -cjs \ No newline at end of file +cjs +esm \ No newline at end of file diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..c596119 --- /dev/null +++ b/.npmignore @@ -0,0 +1,3 @@ +.vscode +src +tests \ No newline at end of file diff --git a/package.json b/package.json index 8c7b917..4234c09 100644 --- a/package.json +++ b/package.json @@ -8,9 +8,9 @@ }, "type": "module", "main": "cjs/index.js", - "module": "dist/index.js", + "module": "esm/index.js", "exports": { - ".": "./dist/index.js", + ".": "./esm/index.js", "./cjs": "./cjs/index.js" }, "devDependencies": { @@ -34,7 +34,7 @@ "scripts": { "format": "prettier --write ./**/*.{ts,js,json,yml,md} --ignore-path .gitignore --log-level=warn --cache --cache-strategy=content --cache-location=.cache/prettier --no-editorconfig", "lint": "eslint --cache --cache-strategy=content --cache-location .cache/eslint", - "build:es": "rm -rf dist && tsc --project tsconfig.json", + "build:es": "rm -rf esm && tsc --project tsconfig.json", "build:cjs": "rm -rf cjs && tsc --project tsconfig.cjs.json || exit 0", "build": "yarn build:es && yarn build:cjs", "test:build": "vite build --config ./tests/vite.config.ts", diff --git a/tsconfig.json b/tsconfig.json index 6896fef..320143c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,7 +19,7 @@ "node" ], "baseUrl": "./src", - "outDir": "./dist", + "outDir": "./esm", "sourceMap": true, "declaration": true }, @@ -30,6 +30,7 @@ "node_modules", ".yarn", "build", - "dist" + "esm", + "cjs" ] } \ No newline at end of file