Does anyone know how to get grunt-uglify-contrib to coordinate symbol mangling between output files?
We have a rather large project and break up our uglified files into 2 or more files.
An example Gruntfile uglify task of ours looks like:
uglify: {
app: {
options: {
compress: false,
//mangle: true,
mangle: {
toplevel: true,
except: ['dog', 'cat', 'fish'],
eval: true
},
preserveComments: false,
sourceMap: false,
beautify: true
},
files: [
{
src: [
'src/dog.js',
'src/cat.js',
],
dest: 'dist/base_app.js'
},
{
src: [
'src/fish.js',
],
dest: 'dist/main_app.js'
}
]
}
}
We want toplevel symbol mangling. But the problem is main_app.js cannot see base_app.js's symbols.
This all works of course if we build it into a single JS file, but that doesn't work well for us.
Any tips on how to get uglify to store the mangled symbol map created while uglifying base_app.js and reuse/reapply the same symbols for main_app.js?
Thanks!