Skip to content

Commit

Permalink
Use react-scripts dependency before publish
Browse files Browse the repository at this point in the history
  • Loading branch information
Timer committed Oct 24, 2016
1 parent 944fa46 commit ee9ca5e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
11 changes: 9 additions & 2 deletions packages/react-dev-utils/BuildProgressPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@

'use strict';

const ProgressPlugin = require('webpack').ProgressPlugin;
const path = require('path');

let ProgressPlugin;
if (__dirname.indexOf(path.join('packages', 'react-dev-utils')) !== -1) {
ProgressPlugin = require('../react-scripts/node_modules/webpack').ProgressPlugin;
} else {
ProgressPlugin = require('webpack').ProgressPlugin;
}
const ProgressBar = require('progress');
const chalk = require('chalk');

Expand All @@ -22,7 +29,7 @@ function BuildProgressPlugin() {
})
return new ProgressPlugin(function(percent, msg) {
if (percent === 1) msg = 'completed';
bar.update(percent, { msg: msg });
bar.update(percent, { msg });
if (percent === 1) bar.terminate();
});
}
Expand Down
4 changes: 3 additions & 1 deletion packages/react-dev-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
"opn": "4.0.2",
"progress": "1.1.8",
"sockjs-client": "1.0.3",
"strip-ansi": "3.0.1",
"strip-ansi": "3.0.1"
},
"peerDependencies": {
"webpack": "^1.13.2"
}
}

0 comments on commit ee9ca5e

Please sign in to comment.