warnAboutDeprecatedCJSRequire.js 978 B

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