diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 00000000..5ecefaed --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,23 @@ +module.exports = function(grunt) { + // Project configuration. + grunt.initConfig({ + pkg: grunt.file.readJSON("package.json"), + uglify: { + js: { + files: { + "client/grunt/test.min.js": [ + "client/grunt/test-1.js", + "client/grunt/test-2.js" + ] + } + } + } + }); + + // Load and run uglify. + grunt.loadNpmTasks("grunt-contrib-uglify"); + grunt.registerTask( + "default", + ["uglify"] + ); +}; diff --git a/client/grunt/test-1.js b/client/grunt/test-1.js new file mode 100644 index 00000000..8e046112 --- /dev/null +++ b/client/grunt/test-1.js @@ -0,0 +1,8 @@ +a = 1; +b = 2; + +var list = [ + 1, + 2, + 3, +]; diff --git a/client/grunt/test-2.js b/client/grunt/test-2.js new file mode 100644 index 00000000..c7bcfae2 --- /dev/null +++ b/client/grunt/test-2.js @@ -0,0 +1,3 @@ +function foo() { + return "bar"; +} \ No newline at end of file diff --git a/client/grunt/test.min.js b/client/grunt/test.min.js new file mode 100644 index 00000000..5d633661 --- /dev/null +++ b/client/grunt/test.min.js @@ -0,0 +1 @@ +function foo(){return"bar"}a=1,b=2;var list=[1,2,3]; \ No newline at end of file diff --git a/package.json b/package.json index b2dc72f3..61bc2f39 100644 --- a/package.json +++ b/package.json @@ -7,13 +7,6 @@ "name": "Mattias Erming", "email": "mattias@mattiaserming.com" }, - "dependencies": { - "lodash": "~2.4.1", - "slate-irc": "https://github.com/erming/slate-irc/tarball/master", - "moment": "~2.5.1", - "connect": "~2.14.3", - "socket.io": "~0.9.16" - }, "keywords": [ "browser", "chat", @@ -29,5 +22,16 @@ "repository": { "type": "git", "url": "https://github.com/erming/shout.git" + }, + "dependencies": { + "lodash": "~2.4.1", + "slate-irc": "https://github.com/erming/slate-irc/tarball/master", + "moment": "~2.5.1", + "connect": "~2.14.3", + "socket.io": "~0.9.16" + }, + "devDependencies": { + "grunt": "^0.4.5", + "grunt-contrib-uglify": "^0.5.0" } }