Replace build_debug target with --dev option
The --dev option also works with browsertest and any other targets that depend on a build.
This commit is contained in:
parent
c705f475b7
commit
8170682e54
40
Gruntfile.js
40
Gruntfile.js
|
@ -22,6 +22,8 @@ module.exports = function(grunt) {
|
||||||
},
|
},
|
||||||
options: {
|
options: {
|
||||||
browserifyOptions: {
|
browserifyOptions: {
|
||||||
|
fullPaths: grunt.option('dev'),
|
||||||
|
debug: grunt.option('dev'),
|
||||||
standalone: 'openpgp'
|
standalone: 'openpgp'
|
||||||
},
|
},
|
||||||
cacheFile: 'browserify-cache.json',
|
cacheFile: 'browserify-cache.json',
|
||||||
|
@ -43,35 +45,6 @@ module.exports = function(grunt) {
|
||||||
plugin: ['browserify-derequire']
|
plugin: ['browserify-derequire']
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
openpgp_debug: {
|
|
||||||
files: {
|
|
||||||
'dist/openpgp_debug.js': ['./src/index.js']
|
|
||||||
},
|
|
||||||
options: {
|
|
||||||
browserifyOptions: {
|
|
||||||
fullPaths: true,
|
|
||||||
debug: true,
|
|
||||||
standalone: 'openpgp'
|
|
||||||
},
|
|
||||||
cacheFile: 'browserify-cache-debug.json',
|
|
||||||
// Don't bundle these packages with openpgp.js
|
|
||||||
external: ['crypto', 'zlib', 'node-localstorage', 'node-fetch', 'asn1.js', 'stream', 'buffer'],
|
|
||||||
transform: [
|
|
||||||
["babelify", {
|
|
||||||
global: true,
|
|
||||||
// Only babelify web-stream-tools, asmcrypto and address-rfc2822 in node_modules
|
|
||||||
only: /^(?:.*\/node_modules\/web-stream-tools\/|.*\/node_modules\/asmcrypto\.js\/|.*\/node_modules\/address-rfc2822\/|(?!.*\/node_modules\/)).*$/,
|
|
||||||
plugins: ["transform-async-to-generator",
|
|
||||||
"syntax-async-functions",
|
|
||||||
"transform-regenerator",
|
|
||||||
"transform-runtime"],
|
|
||||||
ignore: ['*.min.js'],
|
|
||||||
presets: ["env"]
|
|
||||||
}]
|
|
||||||
],
|
|
||||||
plugin: ['browserify-derequire']
|
|
||||||
}
|
|
||||||
},
|
|
||||||
worker: {
|
worker: {
|
||||||
files: {
|
files: {
|
||||||
'dist/openpgp.worker.js': ['./src/worker/worker.js']
|
'dist/openpgp.worker.js': ['./src/worker/worker.js']
|
||||||
|
@ -113,14 +86,6 @@ module.exports = function(grunt) {
|
||||||
to: 'OpenPGP.js v<%= pkg.version %>'
|
to: 'OpenPGP.js v<%= pkg.version %>'
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
openpgp_debug: {
|
|
||||||
src: ['dist/openpgp_debug.js'],
|
|
||||||
dest: ['dist/openpgp_debug.js'],
|
|
||||||
replacements: [{
|
|
||||||
from: /OpenPGP.js VERSION/g,
|
|
||||||
to: 'OpenPGP.js v<%= pkg.version %>'
|
|
||||||
}]
|
|
||||||
},
|
|
||||||
openpgp_min: {
|
openpgp_min: {
|
||||||
src: ['dist/openpgp.min.js'],
|
src: ['dist/openpgp.min.js'],
|
||||||
dest: ['dist/openpgp.min.js'],
|
dest: ['dist/openpgp.min.js'],
|
||||||
|
@ -305,7 +270,6 @@ module.exports = function(grunt) {
|
||||||
grunt.registerTask('version', ['replace:openpgp']);
|
grunt.registerTask('version', ['replace:openpgp']);
|
||||||
grunt.registerTask('replace_min', ['replace:openpgp_min', 'replace:worker_min']);
|
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', ['clean', 'copy:bzip2', 'browserify:openpgp', 'browserify:worker', 'version', 'uglify', 'replace_min']);
|
||||||
grunt.registerTask('build_debug', ['copy:bzip2', 'browserify:openpgp_debug', 'browserify:worker']);
|
|
||||||
grunt.registerTask('documentation', ['jsdoc']);
|
grunt.registerTask('documentation', ['jsdoc']);
|
||||||
grunt.registerTask('default', ['build']);
|
grunt.registerTask('default', ['build']);
|
||||||
// Test/Dev tasks
|
// Test/Dev tasks
|
||||||
|
|
Loading…
Reference in New Issue
Block a user