godaddy / svgs

svgs is a compatiblity layer between svg and react-native-svg
MIT License
191 stars 31 forks source link

Don't package the babel configuration #27

Closed Tvrqvoise closed 6 years ago

Tvrqvoise commented 6 years ago

This solves the same issue as #26 except instead of adding the dependencies, it does not package the babel config so that the missing presets never get required.

coveralls commented 6 years ago

Pull Request Test Coverage Report for Build 18


Totals Coverage Status
Change from base Build 16: 0.0%
Covered Lines: 60
Relevant Lines: 60

💛 - Coveralls
Swaagie commented 6 years ago

This won't work, metro bundler will prefer the react-native source in package.json over the transpiled lib. It would include source code in the native app without proper babel configuration. It might still work since the RN preset includes all required babel plugins and presets to use/transpile the source code, however any other consumer of this module would run into issues. By just using @babel/preset-env this might be fixed. Since later versions of RN include that preset.

Swaagie commented 6 years ago

https://github.com/godaddy/svgs/pull/29/files#diff-b9cfc7f2cdf78a7f4b91a753d10865a2R38 updated the babel dependencies

Swaagie commented 6 years ago

Going to close this as a solution that is not suitable for all use cases.