1
0
mirror of https://github.com/moparisthebest/mail synced 2024-11-22 17:02:17 -05:00

[WO-567] browserify mailreader worker

This commit is contained in:
Felix Hammerl 2014-10-13 18:00:01 +02:00
parent 0519b73cdc
commit 033df2dea8
3 changed files with 25 additions and 14 deletions

View File

@ -116,6 +116,18 @@ module.exports = function(grunt) {
'dist/js/pbkdf2-worker.browserified.js': ['src/js/crypto/pbkdf2-worker.js']
}
},
mailreaderWorker: {
files: {
'dist/js/mailreader-parser-worker.browserified.js': ['node_modules/mailreader/src/mailreader-parser-worker-browserify.js']
},
options: {
external: ['buffer'], // node.js apis not required at build time
browserifyOptions: {
debug: true
}
}
},
unitTest: {
files: {
'test/unit/index.browserified.js': [
@ -171,10 +183,6 @@ module.exports = function(grunt) {
external: ['openpgp', 'node-forge', 'net', 'tls', 'crypto']
}
}
/*
TODO:
mailreader-worker: {},
*/
},
exorcise: {
@ -223,13 +231,21 @@ module.exports = function(grunt) {
sourceMap: true,
sourceMapName: 'dist/js/read-sandbox.min.js.map'
}
},
pbkdf2Worker: {
files: {
'dist/js/pbkdf2-worker.min.js': ['dist/js/pbkdf2-worker.browserified.js']
}
},
mailreaderWorker: {
files: {
'dist/js/mailreader-parser-worker.min.js': ['dist/js/mailreader-parser-worker.browserified.js']
},
options: {
sourceMap: true,
sourceMapName: 'dist/js/mailreader-parser-worker.min.js.map'
}
},
unitTest: {
files: {
'test/unit/index.js': [
@ -323,12 +339,6 @@ module.exports = function(grunt) {
cwd: 'src/',
src: ['*.html', '*.js', '*.json', 'manifest.*'],
dest: 'dist/'
},
integration: {
expand: true,
cwd: 'src/',
src: ['**'],
dest: 'test/integration/src/'
}
},

View File

@ -24,7 +24,8 @@
},
"scripts": {
"test": "grunt && grunt test",
"start": "node server.js"
"start": "node server.js",
"postinstall": "dir=$(pwd) && cd node_modules/mailreader/ && npm install --production && cd $dir"
},
"dependencies": {
"axe-logger": "~0.0.2",
@ -35,7 +36,7 @@
"express": "^4.8.3",
"imap-client": "~0.4.3",
"jquery": "~2.1.1",
"mailreader": "~0.3.5",
"mailreader": "https://github.com/whiteout-io/mailreader/tarball/dev/WO-567",
"morgan": "^1.2.3",
"ng-infinite-scroll": "~1.1.2",
"npmlog": "^0.1.1",

View File

@ -73,7 +73,7 @@ ctrl.buildModules = function() {
var lawnchairDao, restDao, pubkeyDao, privkeyDao, crypto, emailDao, keychain, pgp, userStorage, pgpbuilder, oauth, appConfigStore, auth;
// start the mailreader's worker thread
mailreader.startWorker(config.workerPath + '/mailreader-parser-worker.js');
mailreader.startWorker(config.workerPath + '/mailreader-parser-worker.min.js');
// init objects and inject dependencies
restDao = new RestDAO();