Skip to content

Commit 10656c1

Browse files
committed
[fix] Parcel building bug with TypeScript type declaration
1 parent 15de350 commit 10656c1

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

wrapper/Strapi/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,13 @@
4949
},
5050
"browserslist": "> 0.5%, last 2 versions, not dead, IE 11",
5151
"targets": {
52+
"types": false,
5253
"main": {
5354
"optimize": true
5455
}
5556
},
5657
"scripts": {
57-
"build": "rm -rf .parcel-cache/ dist/ && parcel build",
58+
"build": "rm -rf .parcel-cache/ dist/ && tsc --emitDeclarationOnly && parcel build",
5859
"prepublishOnly": "npm run build"
5960
}
6061
}

wrapper/Strapi/source/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export abstract class StrapiListModel<
9292

9393
populate: StrapiPopulateQuery<D> = {};
9494

95-
protected normalize({ id, documentId, attributes }: StrapiDataItem<D>) {
95+
normalize({ id, documentId, attributes }: StrapiDataItem<D>) {
9696
const data = Object.fromEntries(
9797
Object.entries(attributes).map(([key, value]) => [
9898
key,

wrapper/Strapi/tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
"module": "ES6",
55
"moduleResolution": "Node",
66
"useDefineForClassFields": true,
7+
"declaration": true,
78
"skipLibCheck": true,
8-
"lib": ["ES2023", "DOM"]
9+
"lib": ["ES2023", "DOM"],
10+
"outDir": "dist/"
911
},
1012
"include": ["source/*.ts"]
1113
}

0 commit comments

Comments
 (0)