peoplewareDo / nativescript-svg

Nativescript plugin - support for .SVG file format
Other
70 stars 55 forks source link

Add typings key and fix main key for webpack bundling #20

Closed bradmartin closed 7 years ago

bradmartin commented 7 years ago
victorsosa commented 7 years ago

Thanks, for you PR; I will check it out and merge it ASAP.

bradmartin commented 7 years ago

@victorsosa - I've had some issues with this plugin on 1.3.0 so I've made a few changes to help improve things a bit. The d.ts file doesn't need declare module... at the top level - sometimes this will cause modules to not resolve from my experience. My plugins I don't do this and have no issues so it should be safe here also. I've also done some minor TS changes to the code files by removing unused imports, reducing some code, deleted the old stylers code for NS 2x that was commented out. The last changes are related to internal svg resolution. The current way was trying to resolve nativescript-svg package but I kept getting errors with my app when it was doing this, which didn't make much sense since it's there, so I pulled the module locally into my app and changed all the internal svg imports to just reference the package itself with local paths (../svg). This all works in my NS 3+ app. Another interesting behavior I encountered was a white screen overlaying my app page, very weird and once I fixed all the imports to be local to the module the svg worked as expected in my app.

At any rate, these changes should be safe and cause no breaking changes for anyone.

victorsosa commented 7 years ago

Thanks