Generate key_worker.js

Instead of calling importScripts, which is prone to relative path
issues, generate the worker script with everything it needs included.
This commit is contained in:
lilia 2015-04-08 12:53:04 -07:00
parent 7af42a27c5
commit bdecf5cc44
3 changed files with 39932 additions and 2 deletions

View file

@ -60,6 +60,16 @@ module.exports = function(grunt) {
],
dest: 'js/libtextsecure.js',
},
key_worker: {
options: {
banner: 'var window = this;\n',
},
src: [
'js/libtextsecure.js',
'libtextsecure/key_worker.js'
],
dest: 'js/key_worker.js'
},
libtextsecuretest: {
src: [
'components/mocha/mocha.js',
@ -152,6 +162,10 @@ module.exports = function(grunt) {
files: ['./libtextsecure/*.js', './libtextsecure/storage/*.js'],
tasks: ['concat:libtextsecure']
},
key_worker: {
files: ['<%= concat.key_worker.src %>'],
tasks: ['concat:key_worker']
},
dist: {
files: ['<%= dist.src %>'],
tasks: ['copy']