Martins Untals
Martins Untals

Reputation: 2288

Using meteor.js together with react-three

I am trying to try running meteor together with react and react-three library, that wraps three.js for react. As there are no atmosphere package for this, I am looking into either wrapping it myself or any other method how to use it.

1) How to wrap react-three library into meteor package? I have tried downloading react-three repo, running npm run build and then using resulting react-three.js with package code written like this:

Package.describe({
  summary: "react-three wrapped",
  version: "0.8.0",
  name: "myname:react-three",
});

Npm.depends({
  "react-three": "0.8.0"
});

Package.on_use(function(api) {
  api.versionsFrom("0.9.0");

  api.use('limemakers:three@=0.73.0',['client','server']);

  api.add_files([
    "lib/react-three.js"
  ]);

  api.export("THREE");
  api.export("ReactTHREE");
});

but this does not seem to do the deal, no ReactTHREE is exported. Might be because of the way react-three build process works. Could you point me into the direction on how to build and wrap it properly?

2) Maybe it is possible to use it directly? I tried meteorhacks:npm, but it seems that it is server side only. Anything else that could work?

Upvotes: 0

Views: 157

Answers (1)

jwsomis
jwsomis

Reputation: 56

Meteor 1.3-beta was just released and it has support for js modules, although I haven't had the opportunity to test it. This article has good documentation. https://github.com/meteor/meteor/blob/release-1.3/packages/modules/README.md

Upvotes: 1

Related Questions