Skip to content

Commit

Permalink
[#92] changed ts declarion extension to .d.mts
Browse files Browse the repository at this point in the history
  • Loading branch information
ganigeorgiev committed Dec 6, 2022
1 parent eaec873 commit ac38543
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@ tests
rollup.config.js
tsconfig.json
tsconfig-test.json

# generated markdown previews
README.html
CHANGELOG.html
LICENSE.html
File renamed without changes.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.8.2",
"version": "0.8.3",
"name": "pocketbase",
"description": "PocketBase JavaScript SDK",
"author": "Gani Georgiev",
Expand All @@ -16,7 +16,7 @@
"main": "./dist/pocketbase.es.mjs",
"module": "./dist/pocketbase.es.mjs",
"react-native": "./dist/pocketbase.es.js",
"types": "./dist/pocketbase.es.d.ts",
"types": "./dist/pocketbase.es.d.mts",
"keywords": [
"pocketbase",
"pocketbase-js",
Expand Down
16 changes: 15 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,21 @@ const isProduction = !process.env.ROLLUP_WATCH;

function basePlugins() {
return [
ts(),
ts({
hook: {
outputPath: (path, kind) => {
if (kind === 'declaration') {
// replace .es.d.ts with .es.d.mts (see #92)
//
// this usually is already done in rollup-plugin-ts v3
// and could be removed after upgrading
return path.replace('.es.d.ts', '.es.d.mts');
}

return path;
}
}
}),

// minify if we're building for production
// (aka. npm run build instead of npm run dev)
Expand Down

0 comments on commit ac38543

Please sign in to comment.