node-source-map-support icon indicating copy to clipboard operation
node-source-map-support copied to clipboard

Provide esm version

Open tobiasdiez opened this issue 2 years ago • 2 comments

With more and more build tools (vite, nuxt, etc) going towards an esm-first build, it would be nice if a proper esm interface could be provided, i.e. transpile and distribute esm version, including correct export declaration in package.json.

tobiasdiez avatar Mar 04 '23 04:03 tobiasdiez

vote for pure ESM-only

jimmywarting avatar Apr 05 '23 16:04 jimmywarting

Meanwhile could anyone show a workaround to use it with Vite/Rollup? Importing from 'source-map-support/browser-source-map-support.js' seems to be broken: TypeError: Cannot set properties of undefined (setting 'sourceMapSupport')

UPDATE: Nevermind, all I needed to do was:

import sourceMapSupport from 'source-map-support'
sourceMapSupport.install()

It works just fine with Vite.

BenceSzalai avatar Aug 26 '23 15:08 BenceSzalai