Add inline sourceMap in minified files in grunt build --dev

This commit is contained in:
Daniel Huigens 2020-02-07 08:18:28 +01:00
parent 21c7d69f56
commit de6ab1db49

View File

@ -173,6 +173,13 @@ module.exports = function(grunt) {
'dist/openpgp.worker.min.js' : ['dist/openpgp.worker.js'] 'dist/openpgp.worker.min.js' : ['dist/openpgp.worker.js']
}, },
options: { options: {
output: {
comments: `/^!/`
},
sourceMap: dev ? {
content: 'inline',
url: 'inline'
} : {},
safari10: true safari10: true
} }
} }
@ -185,8 +192,8 @@ module.exports = function(grunt) {
'this is LGPL licensed code, see LICENSE/our website <%= pkg.homepage %> for more information. */' 'this is LGPL licensed code, see LICENSE/our website <%= pkg.homepage %> for more information. */'
}, },
files: { files: {
'dist/openpgp.min.js': 'dist/openpgp.min.js', 'dist/openpgp.js': 'dist/openpgp.js',
'dist/openpgp.worker.min.js': 'dist/openpgp.worker.min.js' 'dist/openpgp.worker.js': 'dist/openpgp.worker.js'
} }
} }
}, },
@ -338,10 +345,10 @@ module.exports = function(grunt) {
grunt.registerTask('replace_min', ['replace:openpgp_min', 'replace:worker_min']); grunt.registerTask('replace_min', ['replace:openpgp_min', 'replace:worker_min']);
grunt.registerTask('build', function() { grunt.registerTask('build', function() {
if (lightweight) { if (lightweight) {
grunt.task.run(['copy:indutny_elliptic', 'browserify:openpgp', 'browserify:worker', 'replace:lightweight_build', 'replace:indutny_global', 'version', 'terser', 'header', 'replace_min']); grunt.task.run(['copy:indutny_elliptic', 'browserify:openpgp', 'browserify:worker', 'replace:lightweight_build', 'replace:indutny_global', 'version', 'header', 'terser', 'replace_min']);
return; return;
} }
grunt.task.run(['browserify:openpgp', 'browserify:worker', 'version', 'terser', 'header', 'replace_min']); grunt.task.run(['browserify:openpgp', 'browserify:worker', 'version', 'header', 'terser', 'replace_min']);
} }
); );
grunt.registerTask('documentation', ['jsdoc']); grunt.registerTask('documentation', ['jsdoc']);