App destroy img folder

I add a img into app/img/myImage.png but its not working. If you create a folder img into build/ the app destroys it.
how can i selove it !!

Create it in app/www/img - that should do it:-)

You could create a build task to copy the image files to the build folder – check out the linked topic for details:

Are there any real benefits of doing it like that compared to just storing it in www from the start? I can’t really think of one

1 Like

Not really, it’s just an alternative way - I would say, a personal preference or an organizational habit.

1 Like

it still doesn’t work
the same probleme when i add fonts
for v2.0.0-beta.37

I had to modify my gulp file to include images and fonts in build. Here it is Material Design Icons?

And here is a SO post about this.

What “doesn’t work”?

If you place your images in app/www/img it should not be cleared out when building the project.

To reference images from your templates the path should be <img src="img/whatever.png">.

. was my first solution but it doesn’t work
it work for you ?

Yes, it works for me. Please notice it should be in app/www/img and not app/www/build/img.

Again, what is it that does not work for you? Are the images removed when building? Do you get a broken image?

it’s work now i //return del(‘www/build’);
in gulpfile.js

Maybe you haven’t referenced the images correctly, check out the linked posts for details:

Images not rendering with htm src but fine with scss background: url(…/img/back.jpg)
how can i selove it ?

Most probably you’re referencing them incorrectly from the HTML files – check out the linked topics that I mentioned above for information on how to reference them.

Hi @iignatov, could you clarify where would be place the img folder for RC0 projects?

I create my project from sidemenu template.

I have this file structure:

project\src
project\src\app
project\src\assets
project\src\pages
project\src\theme

project\www
project\www\assets
project\www\build

If I put the img folder under project\www ionic serve works great but after sometimes the img folder is deleted, I think it’s when I run ionic build android. If I create the img folder under project\src\img or project\src\www\img ionic serve doesn’t work.