ericclemmons / grunt-angular-templates

Grunt build task to concatenate & pre-load your AngularJS templates
MIT License
710 stars 107 forks source link

ngtemplates grunt task is taking too long to execute #115

Closed yavorski closed 9 years ago

yavorski commented 9 years ago

Execution Time (2014-12-12 14:27:51 UTC) ngtemplates:dev 10.6s ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ 100% Total 10.6s

Completed in 12.020s at Fri Dec 12 2014 16:28:01 GMT+0200 (FLE Standard Time) - Waiting...

here is my grunt task declaration:


ngtemplates: {
  options: {
    module: 'templates',
    standalone: true,
    htmlmin: {
      collapseBooleanAttributes:      true,
      collapseWhitespace:             true,
      removeAttributeQuotes:          false,
      removeComments:                 true, // Only if you don't use comment directives!
      removeEmptyAttributes:          false,
      removeRedundantAttributes:      false,
      removeScriptTypeAttributes:     true,
      removeStyleLinkTypeAttributes:  true
    }
  },
  dev: {
    cwd: '<%= yeoman.app %>',
    src: ['modules/**/*.html'],
    dest: '<%= yeoman.app %>/modules/templates/templates.js'
  }
}

and here is verbose output:


Running tasks: ngtemplates:dev

Running "ngtemplates:dev" (ngtemplates) task
Verifying property ngtemplates.dev exists in config...OK
Files: modules/bar/bar.html, modules/billing/billing.html, modules/data-plans/data-plans-upgrades.html, modules/data-plans/data-plans.html, modules/directives/license-holder/license-holder.directive.html, modules/directives/project-numbers/project-numbers.directive.html, modules/directives/quotas/quotas.directive.html, modules/directives/seat-numbers/seat-numbers.directive.html, modules/directives/seats-restore/seats-restore.directive.html, modules/overview/overview.html, modules/seats/seats-buy.html, modules/seats/seats-remove.html, modules/seats/seats.html, modules/select-account/select-account.html, modules/select-account/select-or-create-account.html, modules/sidebar/sidebar.html, modules/upgrades/upgrades.html -> ./app/modules/templates/templates.js
Options: angular="angular", bootstrap=undefined, concat=null, htmlmin={"collapseBooleanAttributes":true,"collapseWhitespace":true,"removeAttributeQuotes":false,"removeComments":true,"removeEmptyAttributes":false,"removeRedundantAttributes":false,"removeScriptTypeAttributes":true,"removeStyleLinkTypeAttributes":true}, module="ya.templates", prefix="", source=undefined, standalone, url=undefined, usemin=null, append=false
Options: angular="angular", bootstrap=undefined, concat=null, htmlmin={"collapseBooleanAttributes":true,"collapseWhitespace":true,"removeAttributeQuotes":false,"removeComments":true,"removeEmptyAttributes":false,"removeRedundantAttributes":false,"removeScriptTypeAttributes":true,"removeStyleLinkTypeAttributes":true}, module="ya.templates", prefix="", source=undefined, standalone, url=undefined, usemin=null, append=false
Reading ./app/modules/bar/bar.html...OK
Reading ./app/modules/billing/billing.html...OK
Reading ./app/modules/data-plans/data-plans-upgrades.html...OK
Reading ./app/modules/data-plans/data-plans.html...OK
Reading ./app/modules/directives/license-holder/license-holder.directive.html...OK
Reading ./app/modules/directives/project-numbers/project-numbers.directive.html...OK
Reading ./app/modules/directives/quotas/quotas.directive.html...OK
Reading ./app/modules/directives/seat-numbers/seat-numbers.directive.html...OK
Reading ./app/modules/directives/seats-restore/seats-restore.directive.html...OK
Reading ./app/modules/overview/overview.html...OK
Reading ./app/modules/seats/seats-buy.html...OK
Reading ./app/modules/seats/seats-remove.html...OK
Reading ./app/modules/seats/seats.html...OK
Reading ./app/modules/select-account/select-account.html...OK
Reading ./app/modules/select-account/select-or-create-account.html...OK
Reading ./app/modules/sidebar/sidebar.html...OK
Reading ./app/modules/upgrades/upgrades.html...OK
Writing ./app/modules/templates/templates.js...OK
File ./app/modules/templates/templates.js created.

Done, without errors.

Execution Time (2014-12-12 14:32:36 UTC)
loading tasks     0ms  0%
ngtemplates:dev  9.8s  ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ 100%
Total 9.8s


yavorski commented 9 years ago

For obvious reasons i tried to compile the same templates with gulp-angular-templatecache npm module.

Here are the results:


$ gulp templates
Using gulpfile ~/Projects/my-project/gulpfile.js
Starting 'templates'...
Finished 'templates' after 71 ms

ericclemmons commented 9 years ago

htmlmin is always the problem:

https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=htmlmin%20hangs

You can check out most of the other issues opened on this project to see they're all htmlmin.

Remove that, and this library is just a wrapper :)