Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added minification of CSS build #332

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**
47 changes: 40 additions & 7 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ const sass = require('node-sass'), tildeImporter = require('grunt-sass-tilde-imp
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
banner: '/*@preserve\n' +
banner: '/*!@preserve\n' +
' * Tempus Dominus Bootstrap4 v<%= pkg.version %> (<%= pkg.homepage %>)\n' +
' * Copyright 2016-<%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
' * Copyright 2016-<%= grunt.template.today("yyyy") %> <%= pkg.author %> and contributors\n' +
' * Licensed under MIT (https://github.com/tempusdominus/bootstrap-3/blob/master/LICENSE)\n' +
' */\n',
jqueryCheck: 'if (typeof jQuery === \'undefined\') {\n' +
Expand Down Expand Up @@ -36,10 +36,10 @@ module.exports = function (grunt) {
dead_code: false // eslint-disable-line
},
output: {
ascii_only: true // eslint-disable-line
ascii_only: true, // eslint-disable-line
comments: 'some'
},
report: 'min',
preserveComments: 'some'
report: 'min'
}
},
eslint: {
Expand All @@ -63,7 +63,7 @@ module.exports = function (grunt) {
compact: false,
'presets': [
[
'es2015',
'@babel/preset-env',
{
'modules': false,
'loose': true
Expand Down Expand Up @@ -148,11 +148,44 @@ module.exports = function (grunt) {
clean: true
}
}
},
postcss: {
options: {
map: false,
processors: [
require('autoprefixer')({
// grid: true
})
]
},
dist: {
src: 'build/css/<%= pkg.name %>.css'
}
},
cssmin: {
options: {
specialComments: 'all'
},
target: {
files: [{
expand: true,
cwd: 'build/css',
src: ['*.css', '!*.min.css'],
dest: 'build/css',
ext: '.min.css'
}]
}
}
});

grunt.loadTasks('tasks');
grunt.loadNpmTasks('grunt-mkdocs');
grunt.loadNpmTasks('grunt-node-sass');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-postcss')
grunt.loadNpmTasks('grunt-contrib-cssmin')
grunt.loadNpmTasks('grunt-contrib-uglify')
grunt.loadNpmTasks('grunt-contrib-watch')

require('load-grunt-tasks')(grunt);
grunt.registerTask('default', 'build:js');
Expand All @@ -165,7 +198,7 @@ module.exports = function (grunt) {
// Task to be run when building
grunt.registerTask('build:js', ['babel:dev', 'concat', 'eslint', 'babel:dist', 'stamp:bootstrap', 'uglify', 'copy']);

grunt.registerTask('build:style', ['sass', 'stamp:css', 'copy']);
grunt.registerTask('build:style', ['sass', 'stamp:css', 'postcss', 'cssmin', 'copy']);

grunt.registerTask('copy', 'Generate docs', function () {
grunt.file.copy('build/js/tempusdominus-bootstrap-4.js', 'src/docs/theme/js/tempusdominus-bootstrap-4.js');
Expand Down
4 changes: 2 additions & 2 deletions build/css/tempusdominus-bootstrap-4.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*@preserve
/*!@preserve
* Tempus Dominus Bootstrap4 v5.1.2 (https://tempusdominus.github.io/bootstrap-4/)
* Copyright 2016-2018 Jonathan Peterson
* Copyright 2016-2020 Jonathan Peterson and contributors
* Licensed under MIT (https://github.com/tempusdominus/bootstrap-3/blob/master/LICENSE)
*/

Expand Down
207 changes: 3 additions & 204 deletions build/css/tempusdominus-bootstrap-4.min.css

Large diffs are not rendered by default.

Loading