Pergunta

What is the best way to use Joose with Meteor (or Meteorite)?

I have only managed to get Joose working if I load the joose-all.min.js but this doesn't seem to allow me to use other Joose libraries (inparticular JoosX-Attribute).

I have also tried creating a package that has in it's package.js file

Npm.depends({
    'joose' : '3.50.0'
});

but that just causes meteor to fail to start with the following error

/home/dev/GDL/gdl-csr/meteor/.meteor/local/build/server/server.js:337 
}).run();
     ^ ReferenceError: Joose is not defined
    at app/gdl-csr.js:1:16
    at /home/dev/GDL/gdl-csr/meteor/.meteor/local/build/server/server.js:298:12
    at Array.forEach (native)
    at Function._.each._.forEach (/home/dev/.meteor/tools/cc18dfef9e/lib/node_modules/underscore/underscore.js:78:11)
    at run (/home/dev/GDL/gdl-csr/meteor/.meteor/local/build/server/server.js:239:7)
=> Exited with code: 1
=> Your application is crashing. Waiting for file change.

Any suggestions to get me going?

Foi útil?

Solução

In meteor variables are scoped to their particular file. So you need to expose Joose. You would have to in one of your lib files use

Joose = Npm.require('joose');

as opposed to

var Joose = Npm.require('joose');
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top