Add npm run build to build both compat and non-compat files

This commit is contained in:
Daniel Huigens 2018-08-08 18:55:01 +02:00
parent a2044a2833
commit 08216bab13
2 changed files with 8 additions and 1 deletions

View File

@ -197,6 +197,12 @@ module.exports = function(grunt) {
cwd: 'node_modules/compressjs/bin/',
src: ['bzip2.build.js'],
dest: 'src/compression/'
},
openpgp_compat: {
expand: true,
cwd: 'dist/',
src: ['*.js'],
dest: 'dist/compat/'
}
},
clean: ['dist/'],
@ -295,7 +301,7 @@ module.exports = function(grunt) {
// Build tasks
grunt.registerTask('version', ['replace:openpgp']);
grunt.registerTask('replace_min', ['replace:openpgp_min', 'replace:worker_min']);
grunt.registerTask('build', ['clean', 'copy:bzip2', 'browserify:openpgp', 'browserify:worker', 'version', 'uglify', 'replace_min']);
grunt.registerTask('build', ['copy:bzip2', 'browserify:openpgp', 'browserify:worker', 'version', 'uglify', 'replace_min']);
grunt.registerTask('documentation', ['jsdoc']);
grunt.registerTask('default', ['build']);
// Test/Dev tasks

View File

@ -28,6 +28,7 @@
"test/crypto"
],
"scripts": {
"build": "grunt build --compat copy:openpgp_compat && grunt build",
"pretest": "grunt",
"test": "grunt test",
"lint": "eslint src"