Skip to content

Instantly share code, notes, and snippets.

@ukabu
Created April 28, 2015 20:56
Show Gist options
  • Save ukabu/1c49dc601bc8ebb13fed to your computer and use it in GitHub Desktop.
Save ukabu/1c49dc601bc8ebb13fed to your computer and use it in GitHub Desktop.
index b70f4ad..4dddb4a 100644
--- a/package.js
+++ b/package.js
@@ -29,22 +29,18 @@ Package.onUse(function(api) {
api.use("meteorhacks:inject-initial@1.0.2", "server");
api.addFiles([
+ // On the client, we use un-minified React, Meteor will minimize when building for prod.
"vendor/react-with-addons-" + reactVersion + ".js",
- "vendor/react-with-addons-" + reactVersion + ".min.js"
- ], "client", {
- isAsset: true
- });
+ "src/window-react.js"
+ ], "client");
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");
+ api.export("React");
// Meteor-enabled components should include the ReactMeteor mixin via
// React.createClass({ mixins: [ReactMeteor.Mixin], ... }) or just
diff --git a/src/window-react.js b/src/window-react.js
new file mode 100644
index 0000000..aef8a22
--- /dev/null
+++ b/src/window-react.js
@@ -0,0 +1,2 @@
+React = window.React;
+delete window.React;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment