How to use the source-map-support/source-map-support.js.install function in source-map-support

To help you get started, we’ve selected a few source-map-support examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github electron-userland / electron-webpack / packages / electron-webpack / src / electron-main-hmr / main-hmr.ts View on Github external
require("source-map-support/source-map-support.js").install()

const socketPath = process.env.ELECTRON_HMR_SOCKET_PATH!
if (socketPath == null) {
  throw new Error(`[HMR] Env ELECTRON_HMR_SOCKET_PATH is not set`)
}

// module, but not relative path must be used (because this file is used as entry)
const HmrClient = require("electron-webpack/out/electron-main-hmr/HmrClient").HmrClient
// tslint:disable:no-unused-expression
new HmrClient(socketPath, (module as any).hot, () => {
  return __webpack_hash__
})

source-map-support

Fixes stack traces for files with source maps

MIT
Latest version published 3 years ago

Package Health Score

71 / 100
Full package analysis

Similar packages