Load Modernizr from Bower, lean build with Grunt
This commit is contained in:
17
Gruntfile.js
17
Gruntfile.js
@@ -65,6 +65,18 @@ module.exports = function(grunt) {
|
||||
jsHandle: 'roots_scripts'
|
||||
}
|
||||
},
|
||||
modernizr: {
|
||||
dist: {
|
||||
devFile: 'assets/vendor/modernizr/modernizr.js',
|
||||
outputFile: 'assets/js/vendor/modernizr.min.js',
|
||||
files: [
|
||||
['assets/js/scripts.min.js'],
|
||||
['assets/css/main.min.css']
|
||||
],
|
||||
uglify: true,
|
||||
parseFiles: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
less: {
|
||||
files: [
|
||||
@@ -107,6 +119,7 @@ module.exports = function(grunt) {
|
||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||
grunt.loadNpmTasks('grunt-contrib-less');
|
||||
grunt.loadNpmTasks('grunt-wp-version');
|
||||
grunt.loadNpmTasks('grunt-modernizr');
|
||||
|
||||
// Register tasks
|
||||
grunt.registerTask('default', [
|
||||
@@ -118,5 +131,9 @@ module.exports = function(grunt) {
|
||||
grunt.registerTask('dev', [
|
||||
'watch'
|
||||
]);
|
||||
grunt.registerTask('build', [
|
||||
'default',
|
||||
'modernizr'
|
||||
]);
|
||||
|
||||
};
|
||||
|
||||
4
assets/js/vendor/modernizr-2.7.0.min.js
vendored
4
assets/js/vendor/modernizr-2.7.0.min.js
vendored
File diff suppressed because one or more lines are too long
4
assets/js/vendor/modernizr.min.js
vendored
Normal file
4
assets/js/vendor/modernizr.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -13,6 +13,7 @@
|
||||
"assets/vendor"
|
||||
],
|
||||
"dependencies": {
|
||||
"modernizr": "2.7.0",
|
||||
"jquery": "1.11.0",
|
||||
"bootstrap": "3.1.0"
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
* Enqueue scripts in the following order:
|
||||
* 1. jquery-1.11.0.min.js via Google CDN
|
||||
* 2. /theme/assets/js/vendor/modernizr-2.7.0.min.js
|
||||
* 2. /theme/assets/js/vendor/modernizr.min.js
|
||||
* 3. /theme/assets/js/main.min.js (in footer)
|
||||
*/
|
||||
function roots_scripts() {
|
||||
@@ -26,7 +26,7 @@ function roots_scripts() {
|
||||
wp_enqueue_script('comment-reply');
|
||||
}
|
||||
|
||||
wp_register_script('modernizr', get_template_directory_uri() . '/assets/js/vendor/modernizr-2.7.0.min.js', array(), null, false);
|
||||
wp_register_script('modernizr', get_template_directory_uri() . '/assets/js/vendor/modernizr.min.js', array(), null, false);
|
||||
wp_register_script('roots_scripts', get_template_directory_uri() . '/assets/js/scripts.min.js', array(), '0fc6af96786d8f267c8686338a34cd38', true);
|
||||
wp_enqueue_script('modernizr');
|
||||
wp_enqueue_script('jquery');
|
||||
|
||||
15
package.json
15
package.json
@@ -8,12 +8,14 @@
|
||||
"url": "git://github.com/roots/roots.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url" : "https://github.com/roots/roots/issues"
|
||||
"url": "https://github.com/roots/roots/issues"
|
||||
},
|
||||
"licenses": [{
|
||||
"type": "MIT",
|
||||
"url": "http://opensource.org/licenses/MIT"
|
||||
}],
|
||||
"licenses": [
|
||||
{
|
||||
"type": "MIT",
|
||||
"url": "http://opensource.org/licenses/MIT"
|
||||
}
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 0.10.0"
|
||||
},
|
||||
@@ -24,6 +26,7 @@
|
||||
"grunt-contrib-uglify": "~0.2.4",
|
||||
"grunt-contrib-watch": "~0.5.3",
|
||||
"grunt-contrib-less": "~0.8.1",
|
||||
"grunt-wp-version": "~0.1.0"
|
||||
"grunt-wp-version": "~0.1.0",
|
||||
"grunt-modernizr": "~0.5.1"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user