-
Notifications
You must be signed in to change notification settings - Fork 33
Minification and uglification question ? #5
Comments
From @okonon on December 29, 2014 14:23 Here is the related, but closed issue #143 Thanks. |
From @jbavari on January 3, 2015 0:33 @softBarbarian We'll be looking at adding this around version 1.3.1. |
From @okonon on January 5, 2015 13:56 Great, not to bug you, but what is the ETA on 1.3.1? |
From @jbavari on January 6, 2015 1:44 Currently, it's looking towards the end of January. In the meantime, you might try my friend Ross' cordova-uglify. |
From @okonon on January 6, 2015 2:49 Reopening, wrong button. Thanks, I will check it out. You saw this right? |
From @mica16 on January 7, 2015 0:58 Personally, I left Gulp and copied (and lightly altered) this great Gruntfile: |
From @EdL on January 7, 2015 1:4 Looking forward to seeing this added to the CLI - will be great to have it integrated rather than everyone trying to come up with their own way to create a release build - or worse, lots of people not even realising that they should be doing this. |
From @mica16 on January 7, 2015 1:6
=> really true |
From @jbavari on January 22, 2015 19:34 The challenge with this feature is making assumptions about the end users. Do we make it optional for those who want it? Or for everyone? Do we add it as a cordova hook? Or have it be run by users directly? |
From @cdarken on January 22, 2015 19:45 Can't it be done like I suggested in issue #143, as hookable steps in ionic.project? |
From @jbavari on January 22, 2015 19:55 Yes, it could be done as hookable steps, for sure. The thing is, you'd have to have the node modules available to do it. I'm considering just adding cordova-uglify in the dependencies of the ionic starting app. Alternatively, I could provide a command, something like Just trying to figure out which direction to take. |
From @cdarken on January 22, 2015 20:0 Can't it be done as an argument to ionic setup ? Like the optional step to add sass support? |
From @jbavari on January 22, 2015 20:17 Having it as a cordova hook would let users have it run every time they execute However, having it as a gulp task would let the user have full control. They would just need to remember to run it before With your suggestion, |
From @cdarken on January 22, 2015 20:31 I see that for sass, everything is by default filled in, except that npm install is not executed, and when you run
I think that this would be the correct approach for minification (or let's call it optimization, because as in my gist, you can also run a custom copy task to only copy what you need, for a recent app I reduced its size with about 6MB by copying only what's required). |
From @jbavari on January 22, 2015 21:57 To clarify - the steps you're describing a user might do:
Add section to
The question is, if we did gulp tasks, how do we get them in the gulpfile of existing users? |
From @cdarken on January 23, 2015 7:54 The steps seem fine to me. |
From @keithdmoore on January 30, 2015 3:35 Any ETA on when/if this will materialize into a release ? |
From @jbavari on February 4, 2015 14:57 @softBarbarian - some of the other team members pushed those releases. I'm not entirely sure what was added. I'll update the changelog. @keithdmoore - As far as the minification - I'm still trying to push for it coming up soon. I've been busy having to address crosswalk errors lately. |
From @okonon on February 26, 2015 19:44 @jbavari - i know you guys are getting really close to 1.0 release and understand that you are very busy. However, i wanted to followup on the progress of this feature. it seems that Thanks |
From @cdarken on March 5, 2015 9:47 There is one single change that makes everything simpler: the addition of "documentRoot" in ionic.project. This way I just modified the scripts to output production code into www and then I run ionic build. |
From @w3apps on April 1, 2015 9:1 +1 for the ability to change the root folder, this will easily fix this problem. |
From @EdL on April 10, 2015 16:59 Hi @jbavari - don't want to bug you at all but just wondering if there was any update on this or thoughts as to how it's going to be implemented? I'm currently using a separate "source" folder where I store what was originally in the www folder. I then use a gulpfile to minify, uglify, concatenate and then copy everything over to the www folder. From the forum I can see that several people are doing something similar. This is working alright but an integrated "out of the box" solution would be awesome. Thanks |
From @anwaramoon on April 12, 2015 22:27 +1 for this. |
From @EdL on April 13, 2015 11:14 Hi - just seen that this is being discussed on another thread ionic-team/ionic-cli#270 Also here ionic-team/ionic-cli#16 |
From @lfv89 on April 19, 2015 17:57 Yep, this out of the box solution would be very helpful. Almost a month ago I volunteered to help the creation of this something like it (#270), but I think this is not a priority for ionic at least for now. |
From @keithdmoore on April 24, 2015 13:51 I really wished this was a higher priority. The community could really use it. Because this functionality is missing, I find my self going back to using the Yeoman Ionic Generator when starting a new project. |
From @cdarken on April 24, 2015 13:58 I will post an updated version of my gist when I have some time. As I said above, just by changing the value of "documentRoot" in ionic.project, everything becomes very simple. |
From @lfv89 on April 24, 2015 14:9 Yes. My small contribution was to add a "createDocumentRoot" property in ionic.project, covering the case when your project was just cloned and doesn't have yet your "output" folder. |
From @lfv89 on April 24, 2015 14:10 *** Since these "output" folders should be in your .gitignore |
From @keithdmoore on May 25, 2015 18:49 @jbavari Any updates as to when/if ionic-cli will have these new build features? |
From @jbavari on May 26, 2015 17:21 @keithdmoore I dont have a time estimate yet. @vasconcelloslf had put in some work on a new gulpfile that would help solve all of those build min/uglify issues. Would you mind taking a look and giving your input on his suggested build process? Keep in mind - this will mainly affect the masses that download and use this tool. For starters, though, we can add it in as an experimental flag or command of its own. You can find it in the comments here: |
From @EdL on June 3, 2015 12:57 Hi guys, Sorry I'm a bit late to the party! I've been following these threads relating to a "build step" both on GitHub and the Ionic forum for a while now and been meaning to post my thoughts. Excuse the lengthy post. First up, I think its great that this is going to be added in one way or another. @vasconcelloslf - thanks for putting together your build process and sharing it. I have a gulp file I posted a while ago that I have been working with on and off - it's not quite as neat or finished as yours! http://forum.ionicframework.com/t/improve-assets-setup-in-ionic-framework/12859/5 I have searched quite a bit through the forums and most people are using Gulp as the build tool either as a manual step or using watchers, so given that, I think Gulp would be the way to go. I think the main ideas people agree on are the following: Providing Dev and Release modes For both dev and release: Sass build. Creating an index.html file referencing the correct destinations depending on whether it is dev or release - I'm still unsure of the best way to do this? Maybe gulp-html-replace ? (Optionally could have a linting step e.g. gulp-jshint with jshint-stylish) For release: Concatenating files Extra thoughts The build step could be triggered by the addition of an attribute on the ionic serve, emulate or build commands. e.g ionic build -b dev or ionic build -b release I don't see the need for having a separate cordova hook, or for a different workflow when running ionic build vs ionic serve or emulate. They could all just take the same attribute and trigger the same build process but for dev or release depending what arg is passed. I really like the idea of providing a setup for source and destination directories in the ionic.project files. I like @vasconcelloslf idea of having dev and release variables and a config file for these. You could say this isn't necessary on the build step as a user could load the relevant constants depending on if they have a dev or build flag set somewhere, but it would be nice if running the build step set a dev/release flag. e.g. set a "build: release" or "build: dev" in a config file somewhere that could then be used at runtime by an app to determine which set of constants to use. Links to the main forum posts on build steps http://forum.ionicframework.com/t/improve-assets-setup-in-ionic-framework/12859/7 Thanks Ed |
From @keithdmoore on October 19, 2015 18:28 @jbavari Any update on this? |
All the notifications. |
+1:+1: I'd minify automatically just when building for the target platform, and not during testing with Note: keep UglifyJs with the |
My example for Ionic 1.x 👯 https://github.com/jdnichollsc/Ionic-Starter-Template |
any updates? Really need the feature to build develop and release. |
From @okonon on December 22, 2014 4:18
Quick question. How does one Minify and uglify your code?
This functionality is provided by yeoman generatior-ionic and I was wondering if there is something like that is offered by ionic-cli?
Copied from original issue: ionic-team/ionic-cli#168
The text was updated successfully, but these errors were encountered: