Skip to content
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

bun build linked sourcemap option #9314

Closed
sk337 opened this issue Mar 8, 2024 · 1 comment · Fixed by #11983
Closed

bun build linked sourcemap option #9314

sk337 opened this issue Mar 8, 2024 · 1 comment · Fixed by #11983
Labels
bundler Something to do with the bundler enhancement New feature or request sourcemaps

Comments

@sk337
Copy link

sk337 commented Mar 8, 2024

What is the problem this feature would solve?

source map external does not link to the source map preventing browser from automatically loading them

What is the feature you are proposing to solve the problem?

add an option to the source map flag named linked the will add a source mapping comment like this
//# sourceMappingURL=index.js.map

What alternatives have you considered?

I made consider internal but I don't serve source maps to users that don't have a enough permission and I cant limit the internal sourcemap

@sk337 sk337 added the enhancement New feature or request label Mar 8, 2024
@Electroid Electroid added bundler Something to do with the bundler sourcemaps labels Mar 8, 2024
@damonsmith
Copy link

My workaround for now is to just append the sourcemapping line myself after calling bun.build() in my build script -

	await Bun.build({
		entrypoints: ['src/index.ts'],
		outdir: 'dist',
		sourcemap: 'external'
	});
	await appendFile("dist/src/index.js", '\n//# sourceMappingURL=index.js.map');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bundler Something to do with the bundler enhancement New feature or request sourcemaps
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants