Skip to content

Commit 7e3475b

Browse files
committed
Install bob to precompile sources
1 parent ebca5b4 commit 7e3475b

File tree

4 files changed

+3125
-9
lines changed

4 files changed

+3125
-9
lines changed

.gitignore

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# TypeScript
2-
dist/
3-
41
# OSX
52
#
63
.DS_Store
@@ -43,3 +40,6 @@ local.properties
4340
buck-out/
4441
\.buckd/
4542
*.keystore
43+
44+
# generated by bob
45+
lib/

package.json

+24-5
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"title": "React Native Blurhash",
44
"version": "1.0.30",
55
"description": "🖼 BlurHash is a compact representation of a placeholder for an image. This is a Native UI Module for React Native to asynchronously wrap the Blurhash implementations and make them usable in React Native. Also supports encoding!",
6-
"main": "dist/index.js",
7-
"types": "dist/index.d.ts",
6+
"main": "lib/commonjs/index.js",
7+
"types": "lib/typescript/src/index.d.ts",
88
"files": [
99
"README.md",
1010
"android/src",
@@ -13,12 +13,15 @@
1313
"ios/**/*.h",
1414
"ios/**/*.m",
1515
"ios/**/*.swift",
16-
"dist/",
16+
"lib/commonjs",
17+
"lib/module",
18+
"lib/typescript",
1719
"react-native-blurhash.podspec"
1820
],
1921
"scripts": {
2022
"lint": "eslint --ext .js,.jsx,.ts,.tsx .",
21-
"prepack": "tsc --noEmit false --skipLibCheck"
23+
"prepack": "tsc --noEmit false --skipLibCheck",
24+
"prepare": "bob build"
2225
},
2326
"repository": {
2427
"type": "git",
@@ -56,6 +59,22 @@
5659
"eslint-plugin-prettier": "^3.3.1",
5760
"eslint-plugin-react-native": "^3.10.0",
5861
"prettier": "^2.2.0",
62+
"react-native-builder-bob": "^0.17.1",
5963
"typescript": "^4.1.4"
60-
}
64+
},
65+
"react-native": "src/index.tsx",
66+
"module": "lib/module/index.js",
67+
"react-native-builder-bob": {
68+
"source": "src",
69+
"output": "lib",
70+
"targets": [
71+
"commonjs",
72+
"module",
73+
"typescript"
74+
]
75+
},
76+
"eslintIgnore": [
77+
"node_modules/",
78+
"lib/"
79+
]
6180
}

tsconfig.json

-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
/* Experimental Options */
5252
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
5353
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
54-
"outDir": "dist"
5554
},
5655
"include": [
5756
"src/*"

0 commit comments

Comments
 (0)