Skip to content

Commit d6e777b

Browse files
authored
fix: copy RiveViewConfig.json to lib during build (#33)
The relative import from nitrogen/generated works in src but fails in lib/module. Added bob custom target to copy the JSON config file to the correct location.
1 parent d6c36ef commit d6e777b

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

package.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
"nitrogen": "nitrogen",
4343
"release": "release-it",
4444
"dev:ios": "cd example && xed ios",
45-
"dev:android": "cd example && open -a \"/Applications/Android Studio.app\" ./android"
45+
"dev:android": "cd example && open -a \"/Applications/Android Studio.app\" ./android",
46+
"copy:nitrogen-config": "mkdir -p lib/nitrogen/generated/shared/json && cp nitrogen/generated/shared/json/RiveViewConfig.json lib/nitrogen/generated/shared/json/"
4647
},
4748
"keywords": [
4849
"react-native",
@@ -160,12 +161,6 @@
160161
"source": "src",
161162
"output": "lib",
162163
"targets": [
163-
[
164-
"custom",
165-
{
166-
"script": "nitrogen"
167-
}
168-
],
169164
[
170165
"module",
171166
{
@@ -177,6 +172,13 @@
177172
{
178173
"project": "tsconfig.build.json"
179174
}
175+
],
176+
[
177+
"custom",
178+
{
179+
"script": "copy:nitrogen-config",
180+
"clean": "lib/nitrogen"
181+
}
180182
]
181183
]
182184
},

0 commit comments

Comments
 (0)