1
0
mirror of https://github.com/moparisthebest/mail synced 2024-12-21 23:08:50 -05:00

Browserify runtime dependencies work

This commit is contained in:
Tankred Hase 2014-10-08 18:36:00 +02:00 committed by Felix Hammerl
parent 7a20049bbc
commit 0bfef4a710
5 changed files with 31 additions and 8 deletions

View File

@ -19,6 +19,7 @@
"predef": [ "predef": [
"self", "self",
"importScripts",
"console", "console",
"process", "process",
"chrome", "chrome",

View File

@ -106,12 +106,17 @@ module.exports = function(grunt) {
}, },
browserify: { browserify: {
all: { app: {
files: { files: {
'dist/js/app.min.js': ['src/js/app.js'] 'dist/js/app.min.js': ['src/js/app.js']
}, },
options: { options: {
external: [] external: ['openpgp', 'node-forge', 'net', 'tls', 'crypto'] // node.js apis not required at build time
}
},
pbkdf2Worker: {
files: {
'dist/js/pbkdf2-worker.min.js': ['src/js/crypto/pbkdf2-worker.js']
} }
}, },
unitTest: { unitTest: {
@ -122,27 +127,25 @@ module.exports = function(grunt) {
external: [] external: []
} }
}, },
/* /*
TODO: TODO:
mailreader-worker: {}, mailreader-worker: {},
pbkdf2-worker: {},
integrationTest: {} integrationTest: {}
*/ */
}, },
uglify: { uglify: {
all: { app: {
files: { files: {
'dist/js/app.min.js': [ 'dist/js/app.min.js': [
'src/lib/openpgp/openpgp.js',
'src/lib/underscore/underscore-min.js', 'src/lib/underscore/underscore-min.js',
'node_modules/jquery/dist/jquery.min.js', 'node_modules/jquery/dist/jquery.min.js',
'src/lib/angular/angular.min.js', 'src/lib/angular/angular.min.js',
'src/lib/angular/angular-route.min.js', 'src/lib/angular/angular-route.min.js',
'src/lib/angular/angular-animate.min.js', 'src/lib/angular/angular-animate.min.js',
'src/lib/ngtagsinput/ng-tags-input.min.js', 'src/lib/ngtagsinput/ng-tags-input.min.js',
'src/lib/fastclick/fastclick.js',
'node_modules/ng-infinite-scroll/build/ng-infinite-scroll.min.js', 'node_modules/ng-infinite-scroll/build/ng-infinite-scroll.min.js',
'src/lib/fastclick/fastclick.js',
'src/lib/lawnchair/lawnchair-git.js', 'src/lib/lawnchair/lawnchair-git.js',
'src/lib/lawnchair/lawnchair-adapter-webkit-sqlite-git.js', 'src/lib/lawnchair/lawnchair-adapter-webkit-sqlite-git.js',
'src/lib/lawnchair/lawnchair-adapter-indexed-db-git.js', 'src/lib/lawnchair/lawnchair-adapter-indexed-db-git.js',
@ -151,6 +154,11 @@ module.exports = function(grunt) {
] ]
} }
}, },
pbkdf2Worker: {
files: {
'dist/js/pbkdf2-worker.min.js': ['dist/js/pbkdf2-worker.min.js']
}
},
unitTest: { unitTest: {
files: { files: {
'test/unit/index.js': [ 'test/unit/index.js': [
@ -171,6 +179,9 @@ module.exports = function(grunt) {
'test/lib/angular-mocks.js', 'test/lib/angular-mocks.js',
'test/unit/index.js' 'test/unit/index.js'
] ]
},
options: {
compress: false
} }
}, },
options: { options: {
@ -186,6 +197,13 @@ module.exports = function(grunt) {
src: ['mocha/mocha.css', 'mocha/mocha.js', 'chai/chai.js', 'sinon/pkg/sinon.js', 'browsercrow/src/*.js', 'browsersmtp/src/*.js'], src: ['mocha/mocha.css', 'mocha/mocha.js', 'chai/chai.js', 'sinon/pkg/sinon.js', 'browsercrow/src/*.js', 'browsersmtp/src/*.js'],
dest: 'test/lib/' dest: 'test/lib/'
}, },
lib: {
expand: true,
flatten: true,
cwd: 'src/lib/',
src: ['openpgp/openpgp.js', 'openpgp/openpgp.worker.js', 'forge/forge.min.js'],
dest: 'dist/js/'
},
font: { font: {
expand: true, expand: true,
cwd: 'src/font/', cwd: 'src/font/',

View File

@ -42,7 +42,7 @@
"pgpbuilder": "~0.4.0", "pgpbuilder": "~0.4.0",
"pgpmailer": "~0.4.0", "pgpmailer": "~0.4.0",
"socket.io": "^1.0.6", "socket.io": "^1.0.6",
"tcp-socket": "^0.3.9", "tcp-socket": "https://github.com/whiteout-io/tcp-socket/tarball/dev/browserify",
"wo-smtpclient": "^0.3.8" "wo-smtpclient": "^0.3.8"
}, },
"devDependencies": { "devDependencies": {

View File

@ -26,6 +26,8 @@
<!-- The Scripts --> <!-- The Scripts -->
<script src="socket.io/socket.io.js"></script> <script src="socket.io/socket.io.js"></script>
<script src="js/openpgp.js"></script>
<script src="js/forge.min.js"></script>
<script src="js/app.min.js"></script> <script src="js/app.min.js"></script>
</head> </head>

View File

@ -1,5 +1,7 @@
'use strict'; 'use strict';
importScripts('forge.min.js');
var pbkdf2 = require('./pbkdf2'); var pbkdf2 = require('./pbkdf2');
/** /**