Skip to content

Some missing source maps variants and options in TypeScript compiler #2887

Closed
@ghost

Description

Please consider the following in your on going efforts:

From node-sass readme https://github.com/sass/node-sass/#sourcecomments:

omitSourceMapUrl

Type: Boolean Default: false

true values disable the inclusion of source map information in the output file.

sourceComments

Type: Boolean Default: false

true enables additional debugging information in the output file as CSS comments

sourceMapContents

Type: Boolean Default: false

true includes the contents in the source map information

sourceMapEmbed

Type: Boolean Default: false

true embeds the source map as a data URI


Notes:

omitSourceMapUrl sounds crazy, but there really are use cases when you want the transpiler to generate .map file while ignoring the sourceMappingURI in JS.

With sourceComments, it does not generate the real, cryptic source-maps, but instead put a comment on each line like /* Line: _, Column:_, File:_ */ in generated code pointing to the source file. Turning on this option has no effect on regular source-map; both options can be enabled and hence the map file produced also keep the line comments into consideration (both can be generated in parallel with little trickery, as you can preemptively determine where the debug comments will appear).

sourceMapContents: this embeds contents of all source (.ts) files in .map as contents array. The order of this array corresponds to sources array.

sourceMapEmbed: compiler generates the source-maps in-memory and instead of stamping out to .map file, it applies the base64 text encoding and append it as a value of sourceMappingURI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DeclinedThe issue was declined as something which matches the TypeScript visionOut of ScopeThis idea sits outside of the TypeScript language design constraintsSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions