Make standalone the default and use openpgp.min.js in node package

This commit is contained in:
Robert Nelson 2014-01-09 17:02:42 -08:00
parent ec061ba101
commit bd963aabf0
3 changed files with 8 additions and 48 deletions

View File

@ -6,35 +6,16 @@ module.exports = function(grunt) {
browserify: { browserify: {
openpgp_nodebug: { openpgp_nodebug: {
files: { files: {
'dist/openpgp_nodebug.js': [] 'dist/openpgp_nodebug.js': [ './src/index.js' ]
},
options: {
alias: [ './src/:openpgp' ],
external: [ 'crypto', 'node-localstorage' ]
}
},
openpgp: {
files: {
'dist/openpgp.js': []
},
options: {
debug: true,
alias: [ './src/:openpgp' ],
external: [ 'crypto', 'node-localstorage' ]
}
},
openpgp_sa_nodebug: {
files: {
'dist/openpgp-sa_nodebug.js': [ './src/index.js' ]
}, },
options: { options: {
standalone: 'openpgp', standalone: 'openpgp',
external: [ 'crypto', 'node-localstorage' ] external: [ 'crypto', 'node-localstorage' ]
} }
}, },
openpgp_sa: { openpgp: {
files: { files: {
'dist/openpgp-sa.js': [ './src/index.js' ] 'dist/openpgp.js': [ './src/index.js' ]
}, },
options: { options: {
debug: true, debug: true,
@ -69,22 +50,6 @@ module.exports = function(grunt) {
from: /OpenPGP.js VERSION/g, from: /OpenPGP.js VERSION/g,
to: 'OpenPGP.js v<%= pkg.version %>.<%= grunt.template.today("yyyymmdd") %>' to: 'OpenPGP.js v<%= pkg.version %>.<%= grunt.template.today("yyyymmdd") %>'
}] }]
},
openpgp_sa: {
src: ['dist/openpgp-sa.js'],
dest: ['dist/openpgp-sa.js'],
replacements: [{
from: /OpenPGP.js VERSION/g,
to: 'OpenPGP.js v<%= pkg.version %>.<%= grunt.template.today("yyyymmdd") %>'
}]
},
openpgp_sa_nodebug: {
src: ['dist/openpgp-sa_nodebug.js'],
dest: ['dist/openpgp-sa_nodebug.js'],
replacements: [{
from: /OpenPGP.js VERSION/g,
to: 'OpenPGP.js v<%= pkg.version %>.<%= grunt.template.today("yyyymmdd") %>'
}]
} }
}, },
uglify: { uglify: {
@ -93,11 +58,6 @@ module.exports = function(grunt) {
'dist/openpgp.min.js' : [ 'dist/openpgp_nodebug.js' ] 'dist/openpgp.min.js' : [ 'dist/openpgp_nodebug.js' ]
} }
}, },
openpgp_sa: {
files: {
'dist/openpgp-sa.min.js' : [ 'dist/openpgp-sa_nodebug.js' ]
}
},
options: { options: {
banner: '/*! OpenPGPjs.org this is LGPL licensed code, see LICENSE/our website for more information.- v<%= pkg.version %> - ' + banner: '/*! OpenPGPjs.org this is LGPL licensed code, see LICENSE/our website for more information.- v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %> */' '<%= grunt.template.today("yyyy-mm-dd") %> */'

View File

@ -4,13 +4,13 @@
"engines": { "engines": {
"node": ">=0.8" "node": ">=0.8"
}, },
"main": "src/index.js", "main": "dist/openpgp.min.js",
"directories": { "directories": {
"lib": "src" "lib": "dist"
}, },
"files": [ "files": [
"src", "dist/openpgp.min.js",
"test" "test/unittests.html", "test/unittests.js", "test/general", "test/crypto"
], ],
"scripts": { "scripts": {
"pretest": "grunt", "pretest": "grunt",

View File

@ -10,7 +10,7 @@
<div id="mocha"></div> <div id="mocha"></div>
<!--<script src="lib/jquery.min.js"></script>--> <!--<script src="lib/jquery.min.js"></script>-->
<script src="../dist/openpgp-sa.js"></script> <script src="../dist/openpgp.js"></script>
<script src="lib/chai.js"></script> <script src="lib/chai.js"></script>
<script src="lib/mocha.js"></script> <script src="lib/mocha.js"></script>
<script> <script>