(css) Minify CSS using clean-css
https://github.com/jakubpawlowicz/clean-css https://github.com/gruntjs/grunt-contrib-cssmin Fixes #3714pull/217/head
parent
d8dc443fa9
commit
cd3e7426cc
3
NEWS
3
NEWS
|
@ -1,4 +1,4 @@
|
|||
3.1.3 (2016-MM-DD)
|
||||
3.1.3 (2016-06-22)
|
||||
------------------
|
||||
|
||||
New features
|
||||
|
@ -12,6 +12,7 @@ Enhancements
|
|||
- [web] always display name of month in week view (#3724)
|
||||
- [web] use a speed dial (instead of a dialog) for card/list creation
|
||||
- [web] use a speed dial for event/task creation
|
||||
- [web] CSS is now minified using clean-css
|
||||
|
||||
Bug fixes
|
||||
- [core] properly handle sorted/deleted calendars (#3723)
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// Load Grunt
|
||||
module.exports = function(grunt) {
|
||||
var js_files = {
|
||||
'js/Common.js': ['js/Common/*.app.js', 'js/Common/*.filter.js', 'js/Common/*Controller.js', 'js/Common/*.service.js', 'js/Common/*.directive.js', 'js/Common/utils.js'],
|
||||
|
@ -23,6 +24,7 @@ module.exports = function(grunt) {
|
|||
|
||||
require('time-grunt')(grunt);
|
||||
|
||||
// Tasks
|
||||
grunt.initConfig({
|
||||
pkg: grunt.file.readJSON('package.json'),
|
||||
sass: {
|
||||
|
@ -34,34 +36,14 @@ module.exports = function(grunt) {
|
|||
'bower_components/breakpoint-sass/stylesheets/'
|
||||
]
|
||||
},
|
||||
dist: {
|
||||
target: {
|
||||
files: {
|
||||
'css/styles.css': 'scss/styles.scss'
|
||||
},
|
||||
options: {
|
||||
outputStyle: 'compressed'
|
||||
}
|
||||
},
|
||||
dev: {
|
||||
files: {
|
||||
'css/styles.css': 'scss/styles.scss'
|
||||
}
|
||||
}
|
||||
},
|
||||
postcss: {
|
||||
dist: {
|
||||
options: {
|
||||
map: false,
|
||||
processors: [
|
||||
require('autoprefixer')({browsers: '> 1%, last 2 versions, last 3 Firefox versions'}),
|
||||
// minifier
|
||||
require('csswring').postcss
|
||||
]
|
||||
// We may consider using css grace (https://github.com/cssdream/cssgrace) for larger support
|
||||
},
|
||||
src: 'css/styles.css'
|
||||
},
|
||||
dev: {
|
||||
target: {
|
||||
options: {
|
||||
map: true,
|
||||
processors: [
|
||||
|
@ -72,6 +54,16 @@ module.exports = function(grunt) {
|
|||
src: 'css/styles.css'
|
||||
}
|
||||
},
|
||||
cssmin: {
|
||||
options: {
|
||||
sourceMap: true,
|
||||
},
|
||||
target: {
|
||||
files: {
|
||||
'css/styles.css': 'css/styles.css'
|
||||
}
|
||||
}
|
||||
},
|
||||
jshint: {
|
||||
files: [].concat(Object.keys(js_files).map(function(v) { return js_files[v]; }))
|
||||
},
|
||||
|
@ -115,12 +107,15 @@ module.exports = function(grunt) {
|
|||
}
|
||||
});
|
||||
|
||||
// Load Grunt plugins
|
||||
grunt.loadNpmTasks('grunt-sass');
|
||||
grunt.loadNpmTasks('grunt-postcss');
|
||||
grunt.loadNpmTasks('grunt-contrib-cssmin');
|
||||
grunt.loadNpmTasks('grunt-contrib-jshint');
|
||||
grunt.loadNpmTasks('grunt-contrib-uglify');
|
||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||
|
||||
// Register Grunt tasks
|
||||
grunt.task.registerTask('static', function() {
|
||||
var options = {
|
||||
'src': 'bower_components',
|
||||
|
@ -183,10 +178,10 @@ module.exports = function(grunt) {
|
|||
*/
|
||||
grunt.task.run('uglify:vendor');
|
||||
});
|
||||
grunt.task.registerTask('build', ['static', 'uglify:dist', 'sass:dist', 'postcss:dist']);
|
||||
grunt.task.registerTask('build', ['static', 'uglify:dist', 'sass', 'postcss', 'cssmin']);
|
||||
// Tasks for developers
|
||||
grunt.task.registerTask('default', ['watch']);
|
||||
grunt.task.registerTask('css', ['sass:dev', 'postcss:dev']);
|
||||
grunt.task.registerTask('css', ['sass', 'postcss']);
|
||||
grunt.task.registerTask('js', ['jshint', 'uglify:dev']);
|
||||
grunt.task.registerTask('dev', ['css', 'js']);
|
||||
};
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
"grunt-contrib-jshint": ">=0.11.2",
|
||||
"grunt-contrib-uglify": ">=0.9",
|
||||
"grunt-contrib-watch": ">=0.5.3",
|
||||
"grunt-contrib-cssmin": ">=1.0.0",
|
||||
"grunt-ng-annotate": ">=0.10.0",
|
||||
"grunt-postcss": ">=0.6.0",
|
||||
"grunt-sass": ">=0.18.1",
|
||||
|
|
Loading…
Reference in New Issue