Skip to content

Commit 3b57a32

Browse files
authored
fix: Add bob to build for web (#326)
* chore: build for web * chore: add missing files
1 parent 424c4a4 commit 3b57a32

File tree

5 files changed

+703
-9
lines changed

5 files changed

+703
-9
lines changed

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ node_modules
33
example/android-bundle.js
44
example/ios-bundle.js
55
example/web-build
6+
7+
# generated by bob
8+
dist/

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,6 @@ web-build
7070

7171
# MSBuild logs
7272
*.binlog
73+
74+
# generated by bob
75+
dist/

package.json

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@
33
"version": "2.0.0",
44
"homepage": "https://github.com/react-native-picker/picker#readme",
55
"description": "React Native Picker for iOS, Android, macOS, and Windows",
6-
"main": "./js/index.js",
6+
"main": "dist/commonjs/index.js",
7+
"module": "dist/module/index.js",
78
"types": "./typings/index.d.ts",
9+
"react-native": "js/index.js",
810
"scripts": {
11+
"prepare": "bob build",
12+
"build": "bob build",
913
"start": "react-native start",
1014
"start:macos": "react-native start --projectRoot ./ --use-react-native-macos",
1115
"ios": "cd example && react-native run-ios",
@@ -69,6 +73,7 @@
6973
"react": "17.0.1",
7074
"react-dom": "17.0.1",
7175
"react-native": "0.64.2",
76+
"react-native-builder-bob": "^0.18.1",
7277
"react-native-macos": "0.61.63",
7378
"react-native-web": "^0.14.10",
7479
"react-native-windows": "^0.64.14",
@@ -120,6 +125,9 @@
120125
"preset": "react-native",
121126
"setupFilesAfterEnv": [
122127
"<rootDir>/jest.setup.js"
128+
],
129+
"modulePathIgnorePatterns": [
130+
"<rootDir>/dist/"
123131
]
124132
},
125133
"repository": {
@@ -128,5 +136,35 @@
128136
},
129137
"publishConfig": {
130138
"access": "public"
131-
}
132-
}
139+
},
140+
"files": [
141+
"js",
142+
"dist",
143+
"!**/__tests__",
144+
"!**/__fixtures__",
145+
"!**/__mocks__",
146+
"ios",
147+
"macos",
148+
"android",
149+
"typings",
150+
"windows",
151+
"RNCPicker.podspec"
152+
],
153+
"react-native-builder-bob": {
154+
"source": "js",
155+
"output": "dist",
156+
"targets": [
157+
[
158+
"commonjs",
159+
{
160+
"flow": true
161+
}
162+
],
163+
"module"
164+
]
165+
},
166+
"eslintIgnore": [
167+
"node_modules/",
168+
"dist/"
169+
]
170+
}

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"include": ["typings/**/*.d.ts"],
33
"compilerOptions": {
4-
"target": "es5",
4+
"target": "es6",
55
"module": "commonjs",
66
"declaration": true,
77
"importHelpers": true,

0 commit comments

Comments
 (0)