Skip to content

Commit

Permalink
mobx peerDependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
timarney committed Jul 6, 2017
1 parent 337efbc commit 63d2f60
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/react-app-rewire-mobx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Install

```bash
$ npm install --save react-app-rewire-mobx
$ npm install --save mobx mobx-react react-app-rewire-mobx
```

# Add it to your project
Expand Down
9 changes: 2 additions & 7 deletions packages/react-app-rewire-mobx/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
const babelLoader = function (conf) {
return conf.loader === 'babel-loader';
};
const {injectBabelPlugin} = require('react-app-rewired');

//webpack2
function rewireMobX(config, env) {
const babelrc = config.module.rules.find(babelLoader).options;
babelrc.plugins = ['transform-decorators-legacy'].concat(babelrc.plugins || []);
return config;
return injectBabelPlugin('transform-decorators-legacy', config);
}

module.exports = rewireMobX;
8 changes: 4 additions & 4 deletions packages/react-app-rewire-mobx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-app-rewire-mobx",
"version": "1.0.4",
"version": "1.0.6",
"description": "",
"main": "index.js",
"scripts": {
Expand All @@ -11,8 +11,8 @@
"babel-plugin-transform-decorators-legacy": "1.3.4"
},
"peerDependencies": {
"react": "^15.6.0",
"mobx": "^3.1.17",
"mobx-react": "^4.2.2"
"react": ">=15.6.0 < 16",
"mobx": ">=3.1.17 < 4",
"mobx-react": ">=4.2.2 < 5"
}
}

0 comments on commit 63d2f60

Please sign in to comment.