1 | "use strict";
|
2 |
|
3 | var printWarning = function() {};
|
4 |
|
5 | if (process.env.NODE_ENV !== "production") {
|
6 | printWarning = function(format, subs) {
|
7 | var index = 0;
|
8 | var message =
|
9 | "Warning: " +
|
10 | (subs.length > 0
|
11 | ? format.replace(/%s/g, function() {
|
12 | return subs[index++];
|
13 | })
|
14 | : format);
|
15 |
|
16 | if (typeof console !== "undefined") {
|
17 | console.error(message);
|
18 | }
|
19 |
|
20 | try {
|
21 |
|
22 |
|
23 |
|
24 | throw new Error(message);
|
25 | } catch (e) {}
|
26 | };
|
27 | }
|
28 |
|
29 | module.exports = function(member) {
|
30 | printWarning(
|
31 | 'Please use `require("react-router").%s` instead of `require("react-router/%s")`. ' +
|
32 | "Support for the latter will be removed in the next major release.",
|
33 | [member, member]
|
34 | );
|
35 | };
|