Making WordPress.org

Changeset 7112


Ignore:
Timestamp:
04/16/2018 04:19:07 AM (7 years ago)
Author:
dd32
Message:

Themes: Add a JS minification grunt task for the themes directory.

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/Gruntfile.js

    r6629 r7112  
    1111module.exports = function( grunt ) {
    1212    var isChild = 'wporg' !== grunt.file.readJSON( 'package.json' ).name;
    13 
    1413
    1514    // Project configuration.
     
    155154            }
    156155        },
     156        uglify: {
     157            options: {
     158                ASCIIOnly: true,
     159                screwIE8: false
     160            },
     161            js: {
     162                expand: true,
     163                cwd: 'js/',
     164                dest: 'js/',
     165                ext: '.min.js',
     166                src: [
     167                    'theme.js',
     168                ]
     169            }
     170        },
    157171        watch: {
    158172            jshint: {
     
    177191    grunt.loadNpmTasks( 'grunt-contrib-watch' );
    178192    grunt.loadNpmTasks( 'grunt-contrib-jshint' );
     193    grunt.loadNpmTasks( 'grunt-contrib-uglify' );
    179194
    180195    grunt.registerTask( 'css', ['sass_globbing', 'sass', 'postcss', 'rtlcss:dynamic'] );
    181     grunt.registerTask( 'default', ['jshint', 'css'] );
    182     grunt.registerTask( 'build', ['css'] );
     196    grunt.registerTask( 'default', ['jshint', 'css', 'uglify:js'] );
     197    grunt.registerTask( 'build', ['css', 'uglify:js'] );
    183198};
    184199
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/package.json

    r6347 r7112  
    1717    "grunt": "^1.0.1",
    1818    "grunt-contrib-jshint": "^1.0.0",
     19    "grunt-contrib-uglify": "~2.0.0",
    1920    "grunt-contrib-watch": "^1.0.0",
    2021    "grunt-postcss": "^0.8.0",
     
    2627  }
    2728}
    28 
Note: See TracChangeset for help on using the changeset viewer.