]> source.dussan.org Git - jquery.git/commitdiff
Build: Move the stripJSONComments variable to the function that uses it
authorMichał Gołębiowski <m.goleb@gmail.com>
Wed, 10 Feb 2016 11:54:25 +0000 (12:54 +0100)
committerMichał Gołębiowski <m.goleb@gmail.com>
Wed, 10 Feb 2016 11:54:25 +0000 (12:54 +0100)
Gruntfile.js

index 0f509e4882bc4f06d8e0dcdec7aa29d798e0cb94..094cd5b98ccfa10a7e333ada452a188f42c3cf92 100644 (file)
@@ -2,7 +2,8 @@ module.exports = function( grunt ) {
        "use strict";
 
        function readOptionalJSON( filepath ) {
-               var data = {};
+               var stripJSONComments = require( "strip-json-comments" ),
+                       data = {};
                try {
                        data = JSON.parse( stripJSONComments(
                                fs.readFileSync( filepath, { encoding: "utf8" } )
@@ -12,7 +13,6 @@ module.exports = function( grunt ) {
        }
 
        var fs = require( "fs" ),
-               stripJSONComments = require( "strip-json-comments" ),
                gzip = require( "gzip-js" ),
                srcHintOptions = readOptionalJSON( "src/.jshintrc" ),
                newNode = !/^v0/.test( process.version ),