Permalink
Browse files

Combine and minify scripts.

  • Loading branch information...
devinsays committed Jun 6, 2014
1 parent 6a46532 commit 92545f47b54081d2f927d188d3b60d132936fbb3
Showing with 32 additions and 4 deletions.
  1. +17 −0 Gruntfile.js
  2. +11 −3 functions.php
  3. +1 −0 js/platform.min.js
  4. +3 −1 package.json
View
@@ -40,6 +40,21 @@ module.exports = function(grunt) {
'style.css': ['style.css'],
}
},
concat: {
build: {
src: [
'js/skip-link-focus-fix.js',
'js/navigation.js'
],
dest: 'js/platform.min.js',
}
},
uglify: {
build: {
src: 'js/platform.min.js',
dest: 'js/platform.min.js'
}
},
makepot: {
target: {
options: {
@@ -62,6 +77,8 @@ module.exports = function(grunt) {
'sass',
'autoprefixer',
'csscomb',
'concat:build',
'uglify:build',
'makepot'
]);
View
@@ -44,7 +44,7 @@ function platform_setup() {
register_nav_menus( array(
'primary' => __( 'Primary Menu', 'platform' ),
) );
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
@@ -94,9 +94,17 @@ function platform_widgets_init() {
function platform_scripts() {
wp_enqueue_style( 'platform-style', get_stylesheet_uri() );
wp_enqueue_script( 'platform-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true );
if ( SCRIPT_DEBUG || WP_DEBUG ) :
wp_enqueue_script( 'platform-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true );
wp_enqueue_script( 'platform-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true );
else :
wp_enqueue_script( 'platform-scripts', get_template_directory_uri() . '/js/platform.min.js', array(), '20140606', true );
wp_enqueue_script( 'platform-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true );
endif;
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -9,6 +9,8 @@
"grunt-wp-i18n": "~0.4.3",
"grunt-contrib-sass": "~0.7.3",
"grunt-autoprefixer": "~0.7.2",
"grunt-csscomb" : "~2.0.1"
"grunt-csscomb" : "~2.0.1",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-uglify": "~0.4.0"
}
}

0 comments on commit 92545f4

Please sign in to comment.