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

Regarding this kind of folders structure.

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 ? :wink:

I really really suggest you go with yeoman and their ionic generator 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

1 Like

@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) .

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

Have fun!

1 Like

Thanks @WidawskiJ :wink:

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?

That was an issue while generating the yo command:

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

1 Like

Amazing :wink: Thanks a lot.

Good by Gulp :slight_smile:

Now my app is 8mo instead of 30 :wink:

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?

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!