Skip to content

sourceMappingURL directive can fail if a bundled module specifies the directive #772

@davidmason

Description

@davidmason

If a bundled module has a sourceMappingURL directive, browserify will leave it intact, which appears to be worthless or harmful towards getting source maps to work properly in browsers.

Ideally, when browserify is generating source maps it would detect sourceMappingURL directives in bundled modules and include the contents of the targeted source maps in the bundle's source map. At very least, the directives should be removed during bundling to prevent possible conflicts.

The same issue is present in webpack, so I will refer to the bug report there rather than duplicate it: webpack/webpack#273

The only difference between browserify and webpack with this issue is that browserify does not use the deprecated //@ form of the directive, so it will only see the issue of duplicate sourceMappingURL directives when the bundled module has a directive in the form //# sourceMappingURL=....

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions