我目前有一个问题,我的咕噜-控制-cssmin任务需要近10分钟才能完成。这个问题发生在我更新grunt和所有插件到当前版本之后。我已经有将近一年没有更新它们了。在更新之前,cssmin任务大约需要5秒才能完成。
更新后运行时增加的原因是什么?我的任务定义是:
cssmin: {
target: {
options: {
banner: '/*! app.min.css <%= grunt.template.today("dd-mm-yyyy") %> */\n',
filename: 'app.min.' + grunt.template.today("ddmmyyyyHHMMss") + '.css'
},
files: {
'app/css/<%= cssmin.target.options.filename %>': [
'app/lib/bower_components/angular-motion/dist/angular-motion.css',
'app/lib/bower_components/ng-sortable/dist/ng-sortable.min.css',
'app/lib/bower_components/pines-notify/pnotify.core.css',
'app/lib/bower_components/pines-notify/pnotify.picon.css',
'app/lib/bower_components/pines-notify/pnotify.buttons.css',
'app/lib/bower_components/pines-notify/pnotify.history.css',
'app/lib/bower_components/angular-bootstrap-colorpicker/css/colorpicker.css',
'app/lib/bower_components/ng-sortable/dist/ng-sortable.min.css',
'app/lib/patches/ui.dynatree.css',
'app/lib/bower_components/selectize/dist/css/selectize.bootstrap3.css',
'app/lib/bower_components/angular-ui-grid/ui-grid.css',
'app/lib/bower_components/angular-resizable/angular-resizable.min.css',
'app/css/screen.css',
'app/css/ie.css'
]
}
}
},发布于 2016-01-12 14:10:14
找到了问题的原因。grunt-cssmin内部使用任务-css。此任务具有“高级”选项。这个选项也可以被设置为grunt-contrib,它将它委托给清洁css。
如果高级选项设置为true,则执行时间约为10分钟。如果将其设置为false,则此任务的执行时间约为6秒。
https://stackoverflow.com/questions/34739403
复制相似问题