Skip to content
This repository was archived by the owner on Aug 4, 2021. It is now read-only.

Exclude typescript-helpers from source maps#64

Merged
TrySound merged 1 commit intorollup:masterfrom
maxdavidson:hide-typescript-helpers
Aug 17, 2016
Merged

Exclude typescript-helpers from source maps#64
TrySound merged 1 commit intorollup:masterfrom
maxdavidson:hide-typescript-helpers

Conversation

@maxdavidson
Copy link
Copy Markdown
Contributor

Fixes #61 by prefixing the typescript-helpers import with "\0". This makes it a virtual module, so we must inject it manually instead of just replacing the path.

This is how rollup-plugin-babel does it, see rollup/rollup-plugin-babel#64. It was implement in Rollup with rollup/rollup#747.

Comment thread test/test.js
const sources = result.map.sources;

function isNotHelper( path ) {
return path.indexOf( 'typescript-helpers' ) === -1;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it equal '\0typescript-helpers'?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just checking that no source path in the generated source map includes the word typescript-helpers. That should cover both \0typescript-helpers and the path to typescript-helpers.js. It's not great, but gets the job done in this simple example.

@TrySound TrySound merged commit 770b224 into rollup:master Aug 17, 2016
@TrySound
Copy link
Copy Markdown
Member

Thanks

@TrySound
Copy link
Copy Markdown
Member

Published 0.8.1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

typescript-helpers.js shouldn't be included in sourcemap

2 participants