-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid sourcemap paths for ESM and CJS bundles #192
Comments
Actually, there's two problems here:
I think we can fix both problems by simply including the |
Note that JSBI has the same bug, so I filed GoogleChromeLabs/jsbi#97 over there. |
I think ultimately the sourcemap config here is just wrong. We aren't actually sourcemapping back to our TS sources, but back to the ts-transpiled files. This isn't great. Instead, we should be merging the sourcemaps together so that the sourcemaps for our bundles point straight back to the TS files, without having to parse another set of embedded sourcemap urls and .map files. I think this is a pretty simple fix, and once I've verified this I'll push a PR up to review. |
Cool. Here's a repro you can use to validate fixes for this issue:
import { Temporal } from '@js-temporal/polyfill';
const today = Temporal.Now.plainDateISO();
|
Fixed by #194. |
The current release (
0.4.2EDIT 0.4.3) emits a sourcemap with invalid file paths, which results in console errors in IDEs like VSCode that prefer file references to inline source references in sourcemaps. I haven't kept up with recent changes in build steps, I believe this is a new problem.Here's the first few lines of
node_modules/@js-temporal/polyfill/dist/index.esm.js.map
:To fix the problem, we should change
../tsc-out
to../lib
. I've run into this problem before, and if my memory is correct there's either a TSC and/or a rollup setting that will allow you to set the correct directory path for the sourcemap. If that's too hard, we could just post-process the output in a build step.The text was updated successfully, but these errors were encountered: