Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build location for custom images #40

Closed
lathonez opened this issue Mar 9, 2016 · 7 comments
Closed

Build location for custom images #40

lathonez opened this issue Mar 9, 2016 · 7 comments

Comments

@lathonez
Copy link
Owner

lathonez commented Mar 9, 2016

I think images should go in resources/images as the resources folder comes from Ionic. If the user has images in a different folder it'll be easy enough for them to change / add the location based on this as an example.

After that we just need to add it to Karma.

So:

  • add some image and include it on a clicker page
  • test said page
  • should get a 404 from Karma
  • add images to karma
@juliocbcotta
Copy link
Contributor

Looking at conference-app structure
they seems to use www/img not carrying about image density which is very odd to me... I don't know how 'default' or 'good pattern' it is... Looking at the conference issues I found this ionic-team/ionic-conference-app#98

@lathonez
Copy link
Owner Author

Interesting. My TL;dr from that issue is:

  • keep images separate from app folder
  • don't copy images at build time (hence putting them in www)

Works for me anyway.

@masimplo
Copy link

I am following the same approach. Images, custom fonts etc are stored directly in the www folder. I do not find a value of copying them (or even process them) in every build. Images should be optimised once before going into the www folder and that's it.
Only issue with this is getting the paths right for referencing images, especially inside css, but once figured out, it works well.

@lathonez
Copy link
Owner Author

Thanks, appreciate the input.
On 14 Apr 2016 20:37, "Michael" [email protected] wrote:

I am following the same approach. Images, custom fonts etc are stored
directly in the www folder. I do not find a value of copying them (or even
process them) in every build. Images should be optimised once before going
into the www folder and that's it.
Only issue with this is getting the paths right for referencing images,
especially inside css, but once figured out, it works well.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#40 (comment)

@lathonez
Copy link
Owner Author

There didn't actually seem to be much to do in the new set up. I've added an image to page2 just for the purposes of this issue really.

Karma doesn't complain about a 404 and protractor sees the image fine.

went with www/images as suggested.

Reopen if I'm missing something or there's more to do.

@mbakker96
Copy link
Contributor

mbakker96 commented Apr 25, 2016

www/assets/images is in my eyes the best solution. I've in my assets folder also my mock JSON files

@lathonez
Copy link
Owner Author

Thanks. Personally I don't see the need for another folder under www, similar to what Ionic do, I just don't like abbreviations for no reason (images instead of img).

This stuff is really subjective. The purpose of this issue was to get a working solution which is easily customisable if you want to use a different path. In the end there wasn't much that needed doing tbh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants