suppress-warnings.cjs 552 B

1234567891011121314151617181920
  1. // borrowed from tsx implementation:
  2. // https://github.com/esbuild-kit/tsx
  3. const ignoreWarnings = new Set([
  4. '--experimental-loader is an experimental feature. This feature could change at any time',
  5. 'Custom ESM Loaders is an experimental feature. This feature could change at any time',
  6. ])
  7. const { emit } = process
  8. process.emit = function (event, warning) {
  9. if (
  10. event === 'warning'
  11. && ignoreWarnings.has(warning.message)
  12. )
  13. return
  14. // eslint-disable-next-line prefer-rest-params
  15. return Reflect.apply(emit, this, arguments)
  16. }