From f99c377e3d0818f7002e0a5043af84d48ecea8ca Mon Sep 17 00:00:00 2001 From: iapyang Date: Thu, 23 Aug 2018 10:55:29 +0800 Subject: [PATCH] update --- Gruntfile.js | 23 ++++++++++++++++++++++- package.json | 4 +++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index c5e33a3df0..e37f71624a 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -215,6 +215,8 @@ module.exports = function (grunt) { } }, + + less: { demo: { expand: true, @@ -254,7 +256,7 @@ module.exports = function (grunt) { uglify: { options: { - banner: "/*! <%= pkg.name %> <%= grunt.template.today(\"dd-mm-yyyy\") %> */\n" + banner: "/*! <%= pkg.name %> <%= grunt.template.today(\"yyyy-mm-dd HH:MM:ss\") %> */\n" }, dist: { files: { @@ -294,6 +296,23 @@ module.exports = function (grunt) { } } }, + copy: { + js: { + files: [ + { + expand: true, + cwd: "dist", + src: [ + "fineui.js" + ], + dest: "dist/", + rename: function (dest, src) { + return dest + src.replace(".js", ".min.js"); + } + } + ] + } + }, watch: { scripts: { files: ["src/**/*.js", "src/**/*.less", "demo/js/**/*.js", "demo/version.js", "demo/config.js", "demo/less/**/*.less"], @@ -336,6 +355,7 @@ module.exports = function (grunt) { grunt.loadNpmTasks("grunt-contrib-cssmin"); grunt.loadNpmTasks("grunt-contrib-connect"); grunt.loadNpmTasks("grunt-contrib-clean"); + grunt.loadNpmTasks("grunt-contrib-copy"); var defaultTask = ["clean", "less", "concat", "connect", "watch"]; grunt.registerTask("default", defaultTask); @@ -344,4 +364,5 @@ module.exports = function (grunt) { grunt.task.run(defaultTask); }); grunt.registerTask("build", ["clean", "less", "cssmin", "concat", "uglify"]); + grunt.registerTask("fake-build", ["clean", "less", "cssmin", "concat", "copy"]); }; diff --git a/package.json b/package.json index 92a9a0ad2f..985cb93e91 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "grunt-contrib-clean": "^1.1.0", "grunt-contrib-concat": "^1.0.1", "grunt-contrib-connect": "^1.0.2", + "grunt-contrib-copy": "^1.0.0", "grunt-contrib-cssmin": "^1.0.1", "grunt-contrib-jshint": "^1.0.0", "grunt-contrib-less": "^1.4.1", @@ -21,7 +22,8 @@ "grunt": "grunt", "start": "node server.js", "build": "grunt build", - "compile": "grunt compile" + "compile": "grunt compile", + "fake": "grunt fake-build" }, "repository": { "type": "git",