generator-ionic icon indicating copy to clipboard operation
generator-ionic copied to clipboard

Why not add grunt-rev ?

Open asgeo1 opened this issue 11 years ago • 4 comments

A different cordova generator I used to use included grunt-rev, so the compiled JS/CSS assets in www would be "versioned".

I.e.

rev: {
  dist: {
    files: {
      src: [
        'www/scripts/{,*/}*.js',
        'www/styles/{,*/}*.css'
      ]
    }
  }
},

Running "rev:dist" (rev) task
www/scripts/scripts.js >> cd7e4895.scripts.js
www/scripts/vendor.js >> 7efd94d7.vendor.js
www/styles/main.css >> 7ad65e9e.main.css
www/styles/vendor.css >> 6e45766f.vendor.css

Perhaps add this to this generator?

I have had issues with mobile safari caching assets before, so this is a handy addition.

asgeo1 avatar Jun 18 '14 07:06 asgeo1

+1

JaKXz avatar Jun 18 '14 19:06 JaKXz

Never heard of this but it looks really neat. Would you be willing to put in a pull request with this?

jimthedev avatar Jul 11 '14 14:07 jimthedev

@asgeo1 I had included the grunt-rev plugin as part of this generator during an early phase, but ended up pulling it out because I wasn't sure if it mattered for apps running inside a UIWebView. Mobile Safari is a whole other beast though, and it would definitely make sense adding it for that reason alone, but are you deploying your ionic app to the web?

I was hoping to keep the Gruntfile as short as possible, but if versioning assets does in fact provide a better experience from within the context of a UIWebView, I would be happy to add grunt-rev to the build system.

diegonetto avatar Jul 11 '14 16:07 diegonetto

Can anyone confirm if versioned assets has any impact on embedded UIWebViews? My gut says it wouldn't but I haven't explored this at any length.

I am willing to add this to the generator if we can proves it alleviates any issues, otherwise there's no point in adding another build system task just for the hell of it.

The only use case I could see for it would be people who were using this generator to build apps meant to be deployed to web servers and used as websites. In that case, yes, this would be necessary, but that's not the focus of this generator.

diegonetto avatar Aug 19 '14 23:08 diegonetto