Created
August 17, 2019 22:21
-
-
Save tyler6699/c2e827a19696d97be11ea0d4fb701668 to your computer and use it in GitHub Desktop.
Grunt file and NPM package file for compressing and obfuscating JS13KB Game
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(grunt) { | |
// Project configuration. | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
uglify: { | |
options: { | |
mangle: { | |
toplevel: true, | |
eval: true, | |
keep_fnames: false, | |
reserved: ["startGame"] | |
} | |
}, | |
build: { | |
files: [{ | |
expand: false, | |
src: 'assets/js/*.js', | |
dest: 'dst/game.min.js', | |
ext: '.min.js' | |
}] | |
} | |
}, | |
watch: { | |
files: ['assets/js/*.js'], | |
tasks: ['uglify'] | |
} | |
}); | |
grunt.loadNpmTasks('grunt-contrib-uglify-es'); | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
grunt.registerTask('default', ['uglify']); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "grunt-getting-started", | |
"version": "0.1.0", | |
"devDependencies": { | |
"grunt": "~0.4.4", | |
"grunt-contrib-uglify-es": "latest", | |
"grunt-contrib-less": "latest", | |
"grunt-contrib-cssmin": "latest", | |
"grunt-contrib-watch": "latest" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment