Browse Source

add minificartion on dist/inputmask

Robin Herbots 11 years ago
parent
commit
13c27cf3c1
1 changed files with 7 additions and 1 deletions
  1. 7 1
      Gruntfile.js

+ 7 - 1
Gruntfile.js

@@ -13,13 +13,19 @@ module.exports = function (grunt) {
         var uglifyConfig = {};
         var uglifyConfig = {};
         var srcFiles = grunt.file.expand(path + "/*.js");
         var srcFiles = grunt.file.expand(path + "/*.js");
         for (var srcNdx in srcFiles) {
         for (var srcNdx in srcFiles) {
-            var dstFile = srcFiles[srcNdx].replace("js/", "");
+            var dstFile = srcFiles[srcNdx].replace("js/", ""),
+                dstFileMin = dstFile.replace(".js", ".min.js");
             wrapAMDLoader(srcFiles[srcNdx], "build/" + dstFile, dstFile.indexOf("extension") == -1 ? ["jquery"] : ["jquery", "./jquery.inputmask"]);
             wrapAMDLoader(srcFiles[srcNdx], "build/" + dstFile, dstFile.indexOf("extension") == -1 ? ["jquery"] : ["jquery", "./jquery.inputmask"]);
             uglifyConfig[dstFile] = {
             uglifyConfig[dstFile] = {
                 dest: 'dist/inputmask/' + dstFile,
                 dest: 'dist/inputmask/' + dstFile,
                 src: "build/" + dstFile,
                 src: "build/" + dstFile,
                 options: { banner: createBanner(dstFile), beautify: true, mangle: false, preserveComments: "some", ASCIIOnly: true }
                 options: { banner: createBanner(dstFile), beautify: true, mangle: false, preserveComments: "some", ASCIIOnly: true }
             };
             };
+            uglifyConfig[dstFileMin] = {
+                dest: 'dist/inputmask/' + dstFileMin,
+                src: "build/" + dstFile,
+                options: { banner: createBanner(dstFileMin), preserveComments: "some", ASCIIOnly: true }
+            };
         }
         }
 
 
         srcFiles = grunt.file.expand(path + "/*.extensions.js");
         srcFiles = grunt.file.expand(path + "/*.extensions.js");