Skip to content

Commit 3335956

Browse files
committed
use microbundle instead of tsc to fix bundling issues
1 parent 98c33ed commit 3335956

File tree

5 files changed

+2363
-52
lines changed

5 files changed

+2363
-52
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ jobs:
1414
cache: 'yarn'
1515
- run: yarn install --frozen-lockfile
1616
- run: yarn lint
17+
- run: yarn type-check
1718
- run: yarn test
1819
- run: yarn build

.github/workflows/npm-publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
cache: yarn
1616
- run: yarn install --frozen-lockfile
1717
- run: yarn lint
18+
- run: yarn type-check
1819
- run: yarn test
1920
- run: yarn build
2021
- uses: actions/upload-artifact@v2

package.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,19 @@
2323
"src"
2424
],
2525
"type": "module",
26-
"main": "./dist/index.js",
27-
"types": "./dist/index.d.ts",
26+
"source": "src/index.ts",
27+
"exports": "./dist/index.js",
28+
"module": "dist/index.module.js",
29+
"main": "dist/index.cjs",
30+
"types": "./dist/types/index.d.ts",
2831
"repository": {
2932
"type": "git",
3033
"url": "https://github.com/dcastil/tailwind-merge.git"
3134
},
3235
"scripts": {
33-
"build": "rm -rf dist/* && tsc --build",
36+
"build": "rm -rf dist/* && microbundle --strict --no-compress --format modern,esm,cjs",
3437
"test": "jest",
38+
"type-check": "tsc --build",
3539
"lint": "eslint --max-warnings 0 '**'"
3640
},
3741
"dependencies": {
@@ -45,6 +49,7 @@
4549
"eslint-plugin-import": "^2.23.4",
4650
"eslint-plugin-jest": "^24.3.6",
4751
"jest": "^27.0.6",
52+
"microbundle": "^0.13.3",
4853
"prettier": "^2.3.2",
4954
"ts-jest": "^27.0.3",
5055
"typescript": "^4.3.5"

tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,18 @@
88
"noUncheckedIndexedAccess": true,
99
"strict": true,
1010
// Modules
11+
"module": "ESNext",
1112
"moduleResolution": "Node",
1213
// Emit
1314
"declaration": true,
15+
"noEmit": true,
1416
"outDir": "dist",
1517
"sourceMap": true,
1618
// Interop Constraints
1719
"esModuleInterop": true,
1820
"forceConsistentCasingInFileNames": true,
1921
// Language and Environment
20-
"target": "ES2020"
22+
"target": "ESNext"
2123
},
2224
"include": ["src/**/*"]
2325
}

0 commit comments

Comments
 (0)