Create source maps using requirejs without including sources?

I am using grunt and requirejs to build and compress our deployment app. We want to create source maps that can be used to debug client code remotely without providing our uncompressed developer code. In requirejs parameters, I specify for optimization:

options: {
    // ...,
    optimize: 'uglify2',
    // ...,
    uglify2: {
        mangle: {
            except: ['jQuery']
        },
        compress: {
            sequences: true,
            booleans: true,
            evaluate: true,
            conditionals: true,
            comparisons: true
        }
    },
    generateSourceMaps: true,
    preserveLicenseComments: false,
    // ...
}

      

This generates the source maps as expected, but they include the source files inside the maps, which greatly increases the file size and provides our original developer code. The UglifyJS2 docs say it supports the sourceMapIncludeSources parameter, which I tried passing in the options object in the uglifyjs2 config, but it doesn't seem to be enforced here. Is there a way to get requirejs to generate source maps without including sources, or make it respect the parameters passed to uglify?

+3


source to share





All Articles