module.exports = function (grunt) {
    grunt.initConfig({
        copy: {
            main: {
                files: [
                    {expand: false, src: ['node_modules/jquery/dist/jquery.min.js'], dest: 'public/js/jquery.min.js', filter: 'isFile'},
                    {expand: false, src: ['node_modules/phaser/dist/phaser.min.js'], dest: 'public/js/phaser.min.js', filter: 'isFile'},
                ],
            },
        },

        uglify: {
            my_target: {
                files: {
                    'public/js//app.min.js': ['src/js/*.js'],
                    'public/js//class.min.js': ['src/js/classes/*.js']
                }
            }
        },

        cssmin: {
            options: {
                mergeIntoShorthands: false,
                roundingPrecision: -1
            },
            target: {
                files: {
                    'public/css//app.min.css': ['src/css/*.css']
                }
            }
        }
    })

    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-uglify-es');
    grunt.loadNpmTasks('grunt-contrib-cssmin');

    grunt.registerTask('cp', ['copy']);
    grunt.registerTask('ugl', ['uglify', 'cssmin']);
    grunt.registerTask('default', ['cp', 'ugl']);
}
