forked from facebookarchive/react-meteor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage.js
62 lines (52 loc) · 1.63 KB
/
package.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
Package.describe({
name: "reactjs:react",
// TODO Consider using reactVersion here, since this version is a lot
// less meaningful?
version: "0.2.3",
summary: "React rendering for Meteor apps",
git: "https://github.com/reactjs/react-meteor/",
documentation: "README.md"
});
// JTG TODO: Should we update this to the latest version of React (0.13.3)?
var reactVersion = "0.13.0";
Npm.depends({
"react": reactVersion
});
Package.registerBuildPlugin({
name: "compileJSX",
use: [],
sources: [
"plugin/compile-jsx.js"
],
npmDependencies: {
"react-tools": reactVersion
}
});
Package.onUse(function(api) {
api.use("meteorhacks:[email protected]", "server");
api.addFiles([
"vendor/react-with-addons-" + reactVersion + ".js",
"vendor/react-with-addons-" + reactVersion + ".min.js"
], "client", {
isAsset: true
});
api.addFiles([
// On the client, we inject a <script> tag to load the appropriate
// version of React according to process.env.NODE_ENV.
"src/inject-react.js",
// On the server, we use the modules that ship with react.
"src/require-react.js"
], "server");
// This React variable is defined in src/require-react.js.
api.export("React", "server");
// Meteor-enabled components should include the ReactMeteor mixin via
// React.createClass({ mixins: [ReactMeteor.Mixin], ... }) or just
// ReactMeteor.createClass({ ... }).
api.addFiles("src/ReactMeteor.js", ["server", "client"]);
api.export("ReactMeteor", ["server", "client"]);
});
Package.onTest(function(api) {
api.use("tinytest");
api.use("reactjs:react");
api.addFiles("react-tests.js");
});