warnAboutDeprecatedCJSRequire.js 917 B

1234567891011121314151617181920212223242526272829303132333435
  1. "use strict";
  2. var printWarning = function() {};
  3. if (process.env.NODE_ENV !== "production") {
  4. printWarning = function(format, subs) {
  5. var index = 0;
  6. var message =
  7. "Warning: " +
  8. (subs.length > 0
  9. ? format.replace(/%s/g, function() {
  10. return subs[index++];
  11. })
  12. : format);
  13. if (typeof console !== "undefined") {
  14. console.error(message);
  15. }
  16. try {
  17. // --- Welcome to debugging React Router ---
  18. // This error was thrown as a convenience so that you can use the
  19. // stack trace to find the callsite that triggered this warning.
  20. throw new Error(message);
  21. } catch (e) {}
  22. };
  23. }
  24. module.exports = function(member) {
  25. printWarning(
  26. 'Please use `require("react-router").%s` instead of `require("react-router/%s")`. ' +
  27. "Support for the latter will be removed in the next major release.",
  28. [member, member]
  29. );
  30. };