Skip to content

Commit 4222e9a

Browse files
committed
🐛 Fixing ES Module exports & types
1 parent 29a0736 commit 4222e9a

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules
22
.DS_Store
33
dist
4+
_types

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@
66
"files": [
77
"dist/*"
88
],
9+
"types": "dist/types.d.ts",
910
"exports": {
10-
"./snackbar": "./dist/snackbar.js",
11-
"./notifications": "./dist/notifications.js",
12-
"./toaster": "./dist/toaster.js"
11+
"./snackbar.js": "./dist/snackbar.js",
12+
"./notifications.js": "./dist/notifications.js",
13+
"./toaster.js": "./dist/toaster.js"
1314
},
1415
"scripts": {
1516
"cleanup": "node ./build/cleanup.js",
1617
"build": "tsc && esbuild ./src/snackbar.ts ./src/notifications.ts ./src/toaster.ts --format=esm --minify --bundle --outdir=dist",
17-
"prerelease": "npm run cleanup && npm run build",
18+
"prerelease": "npm run cleanup && npm run build && cp ./src/types.d.ts ./dist/types.d.ts",
1819
"test": "npm run build && cp -r ./dist ./test/ && serve ./test",
1920
"deploy": "npm run build && cp -r ./dist ./test/ && node ./build/deploy.js"
2021
},

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
"outDir": "./dist",
3+
"outDir": "./_types",
44
"sourceMap": true,
55
"noImplicitAny": true,
66
"experimentalDecorators": true,

0 commit comments

Comments
 (0)