# Cleaning up /www/lib/ionic for distribution

**URL:** <https://forum.ionicframework.com/t/cleaning-up-www-lib-ionic-for-distribution/37507>\
**Category:** ionic-v1\
**Created:** [November 20, 2015, 3:20am UTC](https://forum.ionicframework.com/t/cleaning-up-www-lib-ionic-for-distribution/37507 "2015-11-20T03:20:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [November 20, 2015, 3:20am UTC](https://forum.ionicframework.com/t/cleaning-up-www-lib-ionic-for-distribution/37507/1 "2015-11-20T03:20:04Z")

</div>

Hey,

I just started cleaning up my files to make it ready for distribution and release. That means optimizing lots of images and getting rid of all the unneeded stuff in `/www/lib`. One folder that really surprised me is `/www/lib/ionic/` - it’s huge!

So I dove in, and deleted all the stuff I think I don’t need in production:

- `/www/lib/ionic/scss/*`
- `/www/lib/ionic/css/*`

I am obviously using `ionic setup sass` and now think that I could get rid of the source scss files and the “normal” css file that I don’t use.

Did I miss anything or shouldn’t I have deleted some of these?

---

<div class="post-metadata">

**Author:** ![gmarziou](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/gmarziou/32/13327_2.png) [@gmarziou](https://forum.ionicframework.com/u/gmarziou)\
**Post date:** [November 20, 2015, 10:02am UTC](https://forum.ionicframework.com/t/cleaning-up-www-lib-ionic-for-distribution/37507/2 "2015-11-20T10:02:30Z")

</div>

Ionic starters provide you with a minimal gulp build process, it’s far from being ready for production.  
One major issue is that it puts everything in www, rather than using a source foder and building to www.  
So either you improve it, or you use a better existing one.

---

<div class="post-metadata">

**Author:** ![bengtler](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/bengtler/32/98565_2.png) [@bengtler](https://forum.ionicframework.com/u/bengtler)\
**Post date:** [November 20, 2015, 10:28am UTC](https://forum.ionicframework.com/t/cleaning-up-www-lib-ionic-for-distribution/37507/3 "2015-11-20T10:28:58Z")

</div>

beside of that there are many stuff you can do… like concat templates, and concat+minify js-files, run optipng and optiimage to optimize your resoureces.

i wrote a little tool for me with electron framework of the github makers. there i can login to my gitlab account --\> clone a project, make some settings and at the and it builds my release app by doing extra steps. With the electron framework i can use any node-module i want. 😄

I do not like to change my dev-app and have the whole build stuff in my development project. so i create a new production project —\> change anything there.

I had it to often to change something for production and it magically lands in my dev -repo ^^

---

<div class="post-metadata">

**Author:** ![darshanp](https://avatars.discourse-cdn.com/v4/letter/d/0ea827/32.png) [@darshanp](https://forum.ionicframework.com/u/darshanp)\
**Post date:** [November 20, 2015, 12:01pm UTC](https://forum.ionicframework.com/t/cleaning-up-www-lib-ionic-for-distribution/37507/4 "2015-11-20T12:01:33Z")

</div>

If you are using VS2015, you can use the below cordova plugin: [https://github.com/MagicBoxSoftware/vs-cordova-3-1-ignore-files](https://github.com/MagicBoxSoftware/vs-cordova-3-1-ignore-files). I am not sure if it will work with regular ionic projects or not.

However, you should be able to do something similar with the after\_prepare hooks, e.g. [https://gist.github.com/agustinhaller/426351993c70a0329ad0](https://gist.github.com/agustinhaller/426351993c70a0329ad0) (note: I have not used this personally).

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [November 20, 2015, 1:24pm UTC](https://forum.ionicframework.com/t/cleaning-up-www-lib-ionic-for-distribution/37507/5 "2015-11-20T13:24:21Z")

</div>

> [@gmarziou](#):
>
> Ionic starters provide you with a minimal gulp build process, it’s far from being ready for production.One major issue is that it puts everything in www, rather than using a source foder and building to www.So either you improve it, or you use a better existing one.

Exactly, that’s what I am working on - and trying to find out what exactly could/should be done in there regarding the `/www/lib/ionic` folder. Which files can I get rid of in there? Which do I have to keep although it doesn’t look like it?[quote=“bengtler, post:3, topic:37507”]  
i wrote a little tool for me with electron framework of the github makers.  
[/quote]  
Link?[quote=“darshanp, post:4, topic:37507”]  
If you are using VS2015, you can use the below cordova plugin: [GitHub - MagicBoxSoftware/vs-cordova-3-1-ignore-files: Plugin removes unneeded files from VS Cordova Tools 3.1 packaging operation](https://github.com/MagicBoxSoftware/vs-cordova-3-1-ignore-files). I am not sure if it will work with regular ionic projects or not.  
[/quote]  
Thanks, looking at the source can give me some ideas what I can get rid of in general: [https://github.com/MagicBoxSoftware/vs-cordova-3-1-ignore-files/blob/master/remove-excess-files.js](https://github.com/MagicBoxSoftware/vs-cordova-3-1-ignore-files/blob/master/remove-excess-files.js)[quote=“darshanp, post:4, topic:37507”]  
However, you should be able to do something similar with the after\_prepare hooks, e.g. [ionic After Prepare Hooks · GitHub](https://gist.github.com/agustinhaller/426351993c70a0329ad0) (note: I have not used this personally).  
[/quote]  
That one is also interesting and looks a lot more like what I want to have/build/use. Thanks!

---

<div class="post-metadata">

**Author:** ![gmarziou](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/gmarziou/32/13327_2.png) [@gmarziou](https://forum.ionicframework.com/u/gmarziou)\
**Post date:** [November 20, 2015, 3:33pm UTC](https://forum.ionicframework.com/t/cleaning-up-www-lib-ionic-for-distribution/37507/6 "2015-11-20T15:33:33Z")

</div>

> [@Sujan12](#):
>
> Exactly, that’s what I am working on - and trying to find out what exactly could/should be done in there regarding the /www/lib/ionic folder. Which files can I get rid of in there? Which do I have to keep although it doesn’t look like it?

I think [main-bower-files](https://github.com/ck86/main-bower-files) helps you to include only the required files from your `bower_components` floder into your `www/lib`.  
At least I think this is how [generator-m-ionic](https://github.com/mwaylabs/generator-m-ionic) does it, it does everything I need so I did not look at the details
