Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
17: Introduce Grunt based minification of JS and CSS (#686)
* Introduce Grunt based minification of JS and CSS * Update package versions to latest, update config * Update minified files * Add missing comma * Add jshint hints for Gruntfile.js * Remove incompatible esversion * Fix JSHint issues by using old syntax for now Co-authored-by: Dominik Schilling <dominikschilling+git@gmail.com>
- Loading branch information
Showing
12 changed files
with
1,181 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,6 @@ | |
# Composer | ||
composer.lock | ||
/vendor/ | ||
|
||
npm-debug.log | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* jshint node:true */ | ||
module.exports = function( grunt ) { | ||
var WORKING_DIR = '.'; | ||
|
||
require( 'load-grunt-tasks' )( grunt ); | ||
|
||
grunt.initConfig( { | ||
uglify: { | ||
options: { | ||
output: { | ||
ascii_only: true | ||
} | ||
}, | ||
core: { | ||
expand: true, | ||
cwd: WORKING_DIR, | ||
dest: WORKING_DIR, | ||
src: [ | ||
'assets/js/**/*.js', | ||
|
||
// Exceptions. | ||
'!**/*.min.js' | ||
], | ||
|
||
// Custom rename function to support files with multiple dots. | ||
rename: function( dst, src ) { | ||
return src.replace( '.js', '.min.js' ); | ||
} | ||
} | ||
}, | ||
cssmin: { | ||
core: { | ||
expand: true, | ||
cwd: WORKING_DIR, | ||
dest: WORKING_DIR, | ||
src: [ | ||
'assets/css/*.css', | ||
|
||
// Exceptions. | ||
'!**/*.min.css' | ||
], | ||
|
||
// Custom rename function to support files with multiple dots. | ||
rename: function( dst, src ) { | ||
return src.replace( '.css', '.min.css' ); | ||
} | ||
} | ||
} | ||
} ); | ||
|
||
grunt.registerTask( 'default', [ 'uglify', 'cssmin' ] ); | ||
}; |
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.