I am using grunt-contrib-requirejs to munge my files into a single file and generate a sourcemap. The sourcemap seems to be valid but is 6 lines off in the debuggers in both Chrome and Firefox. I have googled quite a bit but can't find any reasons why this would happen. Has anyone else come across a similar problem?
This is a very large project with about 200 files, i've c/p my grunt config for reference.
dev: {
options: {
baseUrl: 'assets/javascript',
optimize: 'none',
generateSourceMaps: true,
mainConfigFile: 'assets/javascript/requireconfig.js',
name: 'app',
preserveLicenseComments: false,
include: [
'plugins/dropdown-toggle',
'brand/modules/checkmate-init',
'brand/modules/batch-handler',
'brand/modules/dataset-editors',
'brand/modules/recording-editors',
'brand/modules/recording-state'
],
out: 'public/assets/js/myapp.js'
}
},
dist: {
options: {
baseUrl: 'assets/javascript',
optimize: 'uglify2',
generateSourceMaps: false,
mainConfigFile: 'assets/javascript/requireconfig.js',
name: 'app',
include: [
'plugins/dropdown-toggle',
'brand/modules/checkmate-init',
'brand/modules/batch-handler'
],
out: 'public/assets/js/myapp.js'
}
}
This could be related to an issue with https://github.com/requirejs/requirejs/issues/1054
Adding to r.js config:
skipPragmas:true
Did the trick for me.
r.js config: https://github.com/requirejs/r.js/blob/2.2.0/build/example.build.js#L299