Search code examples
gruntjsgrunt-contrib-uglify

grunt - uglify: Uglify to one row code


I'm new to grunt using and I'd like to uglify code to 1 row code. I`m using This grunt plugin. Is it possible?

Thanks for help

 uglify: {
            prod: {
                files: [{
                    expand: true,
                    cwd: '../addon/js',
                    src: ['imagech.js'],
                    dest: '../addon/js/'
                }]
            }

        },


grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.registerTask('addon-prod', ['jshint','uglify:prod']);

Solution

  • uglify has a default max line length of 32000, which probably causes your wrapping. You can disable it by setting maxLineLen to 0 in your grunt options: https://github.com/gruntjs/grunt-contrib-uglify#maxlinelen