# Where do I need to keep Image folder in ionic 2

**URL:** <https://forum.ionicframework.com/t/where-do-i-need-to-keep-image-folder-in-ionic-2/53947>\
**Category:** ionic-v3\
**Created:** [June 5, 2016, 7:06pm UTC](https://forum.ionicframework.com/t/where-do-i-need-to-keep-image-folder-in-ionic-2/53947 "2016-06-05T19:06:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashfaqzeemath](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@ashfaqzeemath](https://forum.ionicframework.com/u/ashfaqzeemath)\
**Post date:** [June 5, 2016, 7:06pm UTC](https://forum.ionicframework.com/t/where-do-i-need-to-keep-image-folder-in-ionic-2/53947/1 "2016-06-05T19:06:54Z")

</div>

I kept image folder inside build folder. But after I do ionic serve the folder will be disappear. Help me

---

<div class="post-metadata">

**Author:** ![fuffenz](https://avatars.discourse-cdn.com/v4/letter/f/db5fbb/32.png) [@fuffenz](https://forum.ionicframework.com/u/fuffenz)\
**Post date:** [June 5, 2016, 7:44pm UTC](https://forum.ionicframework.com/t/where-do-i-need-to-keep-image-folder-in-ionic-2/53947/2 "2016-06-05T19:44:52Z")

</div>

The gulp tasks that are being run every time you rebuild your app will delete everything in the build folder. I think the default gulpfile should handle static assets somehow, but right now it doesn’t.

I store all images and other static assets in app/assets. I’ve modified my gulpfile.js so that it copies all files from app/assets to www/build/assets.

Here’s a sample gulpfile.js that does this:

[https://gist.github.com/fuffenz/72845765c3bd8421345fb2bc1b7d9ba1](https://gist.github.com/fuffenz/72845765c3bd8421345fb2bc1b7d9ba1)

At least for beta7, you can just replace the default gulpfile.js with this one.

---

<div class="post-metadata">

**Author:** ![ashfaqzeemath](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@ashfaqzeemath](https://forum.ionicframework.com/u/ashfaqzeemath)\
**Post date:** [June 5, 2016, 8:08pm UTC](https://forum.ionicframework.com/t/where-do-i-need-to-keep-image-folder-in-ionic-2/53947/3 "2016-06-05T20:08:37Z")

</div>

In my app folder there is no assets folder. How I generate that??

---

<div class="post-metadata">

**Author:** ![fuffenz](https://avatars.discourse-cdn.com/v4/letter/f/db5fbb/32.png) [@fuffenz](https://forum.ionicframework.com/u/fuffenz)\
**Post date:** [June 5, 2016, 8:09pm UTC](https://forum.ionicframework.com/t/where-do-i-need-to-keep-image-folder-in-ionic-2/53947/4 "2016-06-05T20:09:13Z")

</div>

You can just create it as a regular folder.

---

<div class="post-metadata">

**Author:** ![ashfaqzeemath](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@ashfaqzeemath](https://forum.ionicframework.com/u/ashfaqzeemath)\
**Post date:** [June 5, 2016, 8:25pm UTC](https://forum.ionicframework.com/t/where-do-i-need-to-keep-image-folder-in-ionic-2/53947/6 "2016-06-05T20:25:49Z")

</div>

Cannot find module ‘ionic-gulp-browserify-es2015’ (I’m getting this error when I do ionic serve)

---

<div class="post-metadata">

**Author:** ![ashfaqzeemath](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@ashfaqzeemath](https://forum.ionicframework.com/u/ashfaqzeemath)\
**Post date:** [June 5, 2016, 9:41pm UTC](https://forum.ionicframework.com/t/where-do-i-need-to-keep-image-folder-in-ionic-2/53947/7 "2016-06-05T21:41:26Z")

</div>

I changed the gulpfile.js. but after I do ionic serve assets folder desappear from www/build/

---

<div class="post-metadata">

**Author:** ![iignatov](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/iignatov/32/100112_2.png) [@iignatov](https://forum.ionicframework.com/u/iignatov)\
**Post date:** [June 8, 2016, 8:08pm UTC](https://forum.ionicframework.com/t/where-do-i-need-to-keep-image-folder-in-ionic-2/53947/8 "2016-06-08T20:08:52Z")

</div>

> [@ashfaqzeemath](#):
>
> Cannot find module ‘ionic-gulp-browserify-es2015’ (I’m getting this error when I do ionic serve)

This is most probably because you have a TypeScript project and the sample `gulpfile.js` provided by @fuffenz is for a JavaScript project.

I would recommend you to copy the base [`gulpfile.js` for TypeScript](https://github.com/driftyco/ionic2-app-base/blob/typescript/gulpfile.js) and then apply the required changes by yourself, i.e. update the `watch` and `build` tasks by adding the `assets` task and copy the `assets` task itself to the file _(see the TODO comments below)_:

```javascript
// ...
// TODO: Update this task by adding 'assets' as shown below:
gulp.task('watch', ['clean'], function(done){
  runSequence(
    ['sass', 'html', 'fonts', 'scripts', 'assets'],
//...
// TODO: Update this task by adding 'assets' as shown below:
gulp.task('build', ['clean'], function(done){
  runSequence(
    ['sass', 'html', 'fonts', 'scripts', 'assets'],
// ...
// TODO: Copy the task below to your gulpfile.js.
// copy "assets" folder and its content from /app/assets to /www/build/assets
gulp.task('assets', function() {
   return gulp.src('app/assets/*.*')
   .pipe(gulp.dest('www/build/assets'));
});
// ...

```

I would also recommend you to check out the following topic:

> [@Where to place external assets?](https://forum.ionicframework.com/t/where-to-place-external-assets/42762):
>
> Has anyone had any experience with custom assets and where to place them within the project? I have an assets folders with images that are to be used within the app, and i tried placing it in the www folder, and while it works in the browser, the images can’t be reached in an emulator or a real device. If I place it within the build forlder, it works fine, but the build folder doesn’t really exist before the initial build, and it seems like there should be a better way. Anyone solved this probl…

---

<div class="post-metadata">

**Author:** ![ashfaqzeemath](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@ashfaqzeemath](https://forum.ionicframework.com/u/ashfaqzeemath)\
**Post date:** [June 9, 2016, 9:18pm UTC](https://forum.ionicframework.com/t/where-do-i-need-to-keep-image-folder-in-ionic-2/53947/9 "2016-06-09T21:18:49Z")

</div>

thank u I fixed the issue…!! 🙂
