Q: How to Create Sourcemaps with GruntJs Terser JS Minify I'm using Terser for Gruntjs to minify js files.
I want to be able to create a sourcemap but I don't know how to translate the samples I see in the options section (https://www.npmjs.com/package/terser#source-map-options) into my gruntfile.js.
Here is the section where I am minifying and I added where I think the sourceMap options go:
grunt.initConfig({

    terser: {
        pages: {
            options: {
                mangle: {
                    properties: false
                },
                sourceMap: {
                    // source map options goes here I think but not certain what
                }
            },
            files: [
                {   expand: true, 
                    src: '**/*.js', 
                    dest: 'wwwroot/js', 
                    cwd: 'wwwroot/js',
                    ext: '.min.js'
                }
            ]
        }
    }
});

I cannot find a gruntjs example for this anywhere so any input or help would be great

A: I found the answer and have tested it.  Note the sourceMap entry in the options below:
grunt.initConfig({

    terser: {
        pages: {
            options: {
                mangle: {
                    properties: false
                },
                sourceMap: true
            },
            files: [
                {   expand: true, 
                    src: '**/*.js', 
                    dest: 'wwwroot/js', 
                    cwd: 'wwwroot/js',
                    ext: '.min.js'
                }
            ]
        }
    }
});

