From b6cd2cb74afb2ee39efb762795bb7769a0c5080b Mon Sep 17 00:00:00 2001 From: Daniel Lando Date: Tue, 6 Aug 2019 16:31:22 +0200 Subject: [PATCH] [feat] Gruntfile for dist --- GruntFile.js | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 GruntFile.js diff --git a/GruntFile.js b/GruntFile.js new file mode 100644 index 0000000..ace3907 --- /dev/null +++ b/GruntFile.js @@ -0,0 +1,59 @@ +module.exports = function (grunt) { + + require('matchdep').filterAll("grunt-*").forEach(grunt.loadNpmTasks); + + grunt.initConfig({ + + copy: { + js: { + expand: true, + cwd: './', + src: 'justgage.js', + dest: 'dist/' + } + }, + + // jshint: { + // files: [ + // 'Gruntfile.js', + // 'src/js/*.js' + // ], + + // options: { + // globals: { + // console: true + // } + // } + // }, + + uglify: { + options: { + mangle: true, + compress: { + sequences: true, + dead_code: true, + conditionals: true, + booleans: true, + unused: true, + if_return: true, + join_vars: true, + drop_console: true + }, + sourceMap: true, + sourceMapName: 'dist/justgage.min.js.map', + preserveComments: 'some' + }, + js: { + files: { + 'dist/justgage.min.js': ['./justgage.js'] + } + } + } + }); + + grunt.registerTask('build', [ + // 'jshint', + 'copy', + 'uglify', + ]); + }; \ No newline at end of file