Skip to content

Commit 38d0df1

Browse files
authored
feat: setup package to use exports keyword and expose app.plugin.js (#79)
1 parent cedb3cd commit 38d0df1

File tree

1 file changed

+20
-14
lines changed

1 file changed

+20
-14
lines changed

package.json

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,21 @@
33
"version": "2.5.1",
44
"description": "A Modern React Native library that allows you to access orientation",
55
"main": "./lib/module/index.js",
6-
"module": "./lib/module/index.js",
7-
"types": "./lib/typescript/src/index.d.ts",
6+
"types": "./lib/typescript/module/src/index.d.ts",
7+
"exports": {
8+
".": {
9+
"import": {
10+
"types": "./lib/typescript/module/src/index.d.ts",
11+
"default": "./lib/module/index.js"
12+
},
13+
"require": {
14+
"types": "./lib/typescript/commonjs/src/index.d.ts",
15+
"default": "./lib/commonjs/index.js"
16+
}
17+
},
18+
"./package.json": "./package.json",
19+
"./app.plugin.js": "./app.plugin.js"
20+
},
821
"files": [
922
"src",
1023
"lib",
@@ -155,18 +168,11 @@
155168
"source": "src",
156169
"output": "lib",
157170
"targets": [
158-
[
159-
"module",
160-
{
161-
"esm": true
162-
}
163-
],
164-
[
165-
"typescript",
166-
{
167-
"project": "tsconfig.build.json"
168-
}
169-
]
171+
["commonjs", {
172+
"esm": true,
173+
"sourceMaps": false }],
174+
["module", { "esm": true }],
175+
"typescript"
170176
]
171177
},
172178
"codegenConfig": {

0 commit comments

Comments
 (0)