# Do you use the minified files or initial files when testing on the browser?

**URL:** <https://forum.ionicframework.com/t/do-you-use-the-minified-files-or-initial-files-when-testing-on-the-browser/15095>\
**Category:** ionic-v1\
**Created:** [January 5, 2015, 11:14am UTC](https://forum.ionicframework.com/t/do-you-use-the-minified-files-or-initial-files-when-testing-on-the-browser/15095 "2015-01-05T11:14:52Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mik378](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mik378/32/7777_2.png) [@Mik378](https://forum.ionicframework.com/u/Mik378)\
**Post date:** [January 5, 2015, 11:14am UTC](https://forum.ionicframework.com/t/do-you-use-the-minified-files-or-initial-files-when-testing-on-the-browser/15095/1 "2015-01-05T11:14:52Z")

</div>

Regarding [this kind of folders structure](http://forum.ionicframework.com/t/restructuring-from-www-to-app-folder-in-order-to-minify/14601/7?u=mik378).

It sounds that when running `ionic serve` command, the minified files would be used, not the original, since based on `www`.

I’m curious to know whether some good ionic developers use the minified files in the browser (although hard to debug).

Otherwise, should I manually change the ionic’s serve.js file (source of the `ionic serve` command) to point now on `app` rather than `www`.

How do you do ? 😉

---

<div class="post-metadata">

**Author:** ![WidawskiJ](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/widawskij/32/7606_2.png) [@WidawskiJ](https://forum.ionicframework.com/u/WidawskiJ)\
**Post date:** [January 5, 2015, 11:22am UTC](https://forum.ionicframework.com/t/do-you-use-the-minified-files-or-initial-files-when-testing-on-the-browser/15095/2 "2015-01-05T11:22:03Z")

</div>

I really really suggest you go with [yeoman and their ionic generator](https://github.com/diegonetto/generator-ionic) if you’re looking for maximal compression. Their gruntfile is perfect for a ionic project, and you end up with 3 files : a main.css, an app.js and all your bower dependencies (including ionic) compressed in one file. It reduced the size of my project by 2/3.

Hope you’ll like it

---

<div class="post-metadata">

**Author:** ![Mik378](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mik378/32/7777_2.png) [@Mik378](https://forum.ionicframework.com/u/Mik378)\
**Post date:** [January 5, 2015, 11:45am UTC](https://forum.ionicframework.com/t/do-you-use-the-minified-files-or-initial-files-when-testing-on-the-browser/15095/3 "2015-01-05T11:45:37Z")

</div>

@WidawskiJ Since I already have a full ionic project using Gulp, it means that I only should download grunt, copy their gruntfile and configure ( alter it) to match my folders (since I Hate the by-types organisation. I prefer by-feature) .

---

<div class="post-metadata">

**Author:** ![WidawskiJ](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/widawskij/32/7606_2.png) [@WidawskiJ](https://forum.ionicframework.com/u/WidawskiJ)\
**Post date:** [January 5, 2015, 11:58am UTC](https://forum.ionicframework.com/t/do-you-use-the-minified-files-or-initial-files-when-testing-on-the-browser/15095/4 "2015-01-05T11:58:08Z")

</div>

Exactly yes, I understand your hate for the by-type, but I love their architecture nonetheless!

Have fun!

---

<div class="post-metadata">

**Author:** ![Mik378](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mik378/32/7777_2.png) [@Mik378](https://forum.ionicframework.com/u/Mik378)\
**Post date:** [January 5, 2015, 12:12pm UTC](https://forum.ionicframework.com/t/do-you-use-the-minified-files-or-initial-files-when-testing-on-the-browser/15095/5 "2015-01-05T12:12:21Z")

</div>

Thanks @WidawskiJ😉

One question: did you run any npm install (not written on the doc) before using Yeoman grunt command?  
I just created a sample directory to run the full `yo ionic app-name`.

I then run inside the project: `sudo npm install` and when I run `grunt`, I get:

`Error: Cannot find module 'cordova'`

Should it be global with `npm install -g cordova`?

---

<div class="post-metadata">

**Author:** ![Mik378](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mik378/32/7777_2.png) [@Mik378](https://forum.ionicframework.com/u/Mik378)\
**Post date:** [January 5, 2015, 12:26pm UTC](https://forum.ionicframework.com/t/do-you-use-the-minified-files-or-initial-files-when-testing-on-the-browser/15095/6 "2015-01-05T12:26:56Z")

</div>

That was an issue while generating the yo command:

I have run : `chmod 777 -R /Users/myname/.npm` to fix a writing issue.

---

<div class="post-metadata">

**Author:** ![Mik378](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mik378/32/7777_2.png) [@Mik378](https://forum.ionicframework.com/u/Mik378)\
**Post date:** [January 5, 2015, 12:35pm UTC](https://forum.ionicframework.com/t/do-you-use-the-minified-files-or-initial-files-when-testing-on-the-browser/15095/7 "2015-01-05T12:35:10Z")

</div>

Amazing 😉 Thanks a lot.

Good by Gulp 🙂

---

<div class="post-metadata">

**Author:** ![Mik378](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mik378/32/7777_2.png) [@Mik378](https://forum.ionicframework.com/u/Mik378)\
**Post date:** [January 6, 2015, 12:53am UTC](https://forum.ionicframework.com/t/do-you-use-the-minified-files-or-initial-files-when-testing-on-the-browser/15095/8 "2015-01-06T00:53:07Z")

</div>

Now my app is 8mo instead of 30 😉

However, is it right that we can bypass the template cache since the ionic generator already minifies HTML files, and especially because there is no network latency on a mobile to retrieve those HTML?

---

<div class="post-metadata">

**Author:** ![edd](https://avatars.discourse-cdn.com/v4/letter/e/8c91f0/32.png) [@edd](https://forum.ionicframework.com/u/edd)\
**Post date:** [April 10, 2015, 4:42pm UTC](https://forum.ionicframework.com/t/do-you-use-the-minified-files-or-initial-files-when-testing-on-the-browser/15095/9 "2015-04-10T16:42:57Z")

</div>

There will be minimal latency as the files are already on the mobile, but still, if you have a lot of large templates it may be worth adding into the template cache and you may get some improvement.  
I’m of the thought that if I’m already optimising, I might as well go the whole way!
