browser.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. var BrowserslistError = require('./error')
  2. function noop() {}
  3. module.exports = {
  4. loadQueries: function loadQueries() {
  5. throw new BrowserslistError(
  6. 'Sharable configs are not supported in client-side build of Browserslist'
  7. )
  8. },
  9. getStat: function getStat(opts) {
  10. return opts.stats
  11. },
  12. loadConfig: function loadConfig(opts) {
  13. if (opts.config) {
  14. throw new BrowserslistError(
  15. 'Browserslist config are not supported in client-side build'
  16. )
  17. }
  18. },
  19. loadCountry: function loadCountry() {
  20. throw new BrowserslistError(
  21. 'Country statistics are not supported ' +
  22. 'in client-side build of Browserslist'
  23. )
  24. },
  25. loadFeature: function loadFeature() {
  26. throw new BrowserslistError(
  27. 'Supports queries are not available in client-side build of Browserslist'
  28. )
  29. },
  30. currentNode: function currentNode(resolve, context) {
  31. return resolve(['maintained node versions'], context)[0]
  32. },
  33. parseConfig: noop,
  34. readConfig: noop,
  35. findConfig: noop,
  36. findConfigFile: noop,
  37. clearCaches: noop,
  38. oldDataWarning: noop,
  39. env: {}
  40. }