Browse Source

Merge pull request #752 from ehartford/master

add -all.js and -all.min.js
文翼 10 years ago
parent
commit
e64fb82025
2 changed files with 14 additions and 2 deletions
  1. 13 2
      Gruntfile.js
  2. 1 0
      package.json

+ 13 - 2
Gruntfile.js

@@ -14,13 +14,23 @@ module.exports = function(grunt) {
                 '*/\n',
         // Task configuration.
         clean: ['dist', 'docs/dist'],
+        concat: {
+            options: {
+              separator: ';',
+            },
+            dist: {
+              src: ['src/<%= pkg.name %>.js', 'src/extensions/**/*.js'],
+              dest: 'dist/<%= pkg.name %>-all.js',
+            },
+        },
         uglify: {
             options: {
                 banner: '<%= banner %>'
             },
             my_target: {
                 files: {
-                    'dist/<%= pkg.name %>.min.js': ['src/<%=pkg.name %>.js']
+                    'dist/<%= pkg.name %>.min.js': ['src/<%=pkg.name %>.js'],
+                    'dist/<%= pkg.name %>-all.min.js': ['dist/<%=pkg.name %>-all.js']
                 }
             },
             locale_target: {
@@ -69,9 +79,10 @@ module.exports = function(grunt) {
     });
 
     grunt.loadNpmTasks('grunt-contrib-clean');
+    grunt.loadNpmTasks('grunt-contrib-concat');
     grunt.loadNpmTasks('grunt-contrib-uglify');
     grunt.loadNpmTasks('grunt-contrib-cssmin');
     grunt.loadNpmTasks('grunt-contrib-copy');
 
-    grunt.registerTask('default', ['clean', 'uglify', 'cssmin', 'copy']);
+    grunt.registerTask('default', ['clean', 'concat', 'uglify', 'cssmin', 'copy']);
 };

+ 1 - 0
package.json

@@ -8,6 +8,7 @@
   },
   "dependencies": {
     "grunt-contrib-copy": "^0.8.0",
+    "grunt-contrib-concat": "^0.5.1",
     "grunt-contrib-clean": "^0.6.0",
     "grunt-contrib-cssmin": "^0.12.2",
     "grunt-contrib-uglify": "^0.8.0",