I\'m trying to use dynamic mapping AND concat Javascript files with Grunt Uglify.
I have the following which is not working correctly.
Here is my folder structur
You can use the banner property of grunt-contrib-uglify to append the content. https://github.com/gruntjs/grunt-contrib-uglify#banner
Here is the grunt configuration:
grunt.initConfig({
uglify: {
options: {
banner: grunt.file.read('./javascript/account/custom.js'),
beautify: true,
mangle: false,
compress: false,
preserveComments: 'all'
},
files: {
expand: true,
cwd: 'javascript/',
src: ['bills/*.js'],
dest: 'test/',
ext: '.min.js',
extDot: 'first'
},
}
});
In the above configuration every file in the bills folder will get the content of custom.js configured in the banner property.
I hope it helps you.