Skip to content

Commit

Permalink
avoid maintaining vendor files in package by using npm instead for gr…
Browse files Browse the repository at this point in the history
  • Loading branch information
elidoran committed May 24, 2015
1 parent 723f782 commit 27b7662
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 21,665 deletions.
1 change: 1 addition & 0 deletions .npm/package/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
7 changes: 7 additions & 0 deletions .npm/package/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
This directory and the files immediately inside it are automatically generated
when you change this package's NPM dependencies. Commit the files in this
directory (npm-shrinkwrap.json, .gitignore, and this README) to source control
so that others run the same versions of sub-dependencies.

You should NOT check in the node_modules directory that Meteor automatically
creates; if you are using git, the .gitignore file tells git to ignore it.
36 changes: 36 additions & 0 deletions .npm/package/npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions package.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ Package.describe({
git: "https://github.com/grovelabs/meteor-react/"
});

var reactPath = 'vendor/react-with-addons-';
var reactVersion = "0.13.3";
// get `react` npm module
Npm.depends({
'react':'0.13.3'
});

Package.onUse( function(api) {
api.versionsFrom('METEOR@1.1');
Expand All @@ -18,16 +20,18 @@ Package.onUse( function(api) {
'underscore'
], 'client');

var reactPath = '.npm/package/node_modules/react/dist/react-with-addons';

if (process.argv[2] === 'build') {
// The difference between development and production
// versions of React is more than just minification. There are also
// warnings that are removed and optimizations in place in the
// production version when built from source with NPM.
// Since we can't do that we check if we're building the app
// for production and load the pre-built version
api.addFiles( reactPath + reactVersion + '.min.js');
api.addFiles( reactPath + '.min.js');
} else {
api.addFiles( reactPath + reactVersion + '.js');
api.addFiles( reactPath + '.js');
}

api.addFiles([
Expand All @@ -40,4 +44,4 @@ Package.onUse( function(api) {
'DDPMixin'
], 'client');

});
});
Loading

0 comments on commit 27b7662

Please sign in to comment.