stencilproject/Stencil

FileSystemLoader's bundle-based initializer misses bundle resources on macOS

nolanw opened this issue · 2 comments

Hello! I recently tried getting an iOS project running on Catalyst and one of the issues I came across was that FileSystemLoader couldn't load any template files on macOS (while it works fine on iOS). Looking at the implementation, the reason was clear: while iOS bundles put resources at the bundle root, macOS bundles put them in a Resources subdirectory, and FileSystemLoader.init(bundle:) doesn't use Bundle.resourcePath or Bundle.resourceURL so it was looking in the wrong place.

I'm happy to pass in resourceURL myself (or write my own lil BundleResourceLoader) but I figured I'd ask: would it be a useful contribution to adjust FileSystemLoader somehow to consider resourceURL, and/or to add a BundleResourceLoader? I can open a PR if that'd be useful. If not, I'm happy to go about my day :)

schwa commented

Question asked in July…

Question asked in July x2...