Skip to content

Production build should not reference sourcemaps #41810

@lonix1

Description

@lonix1

Prerequisites

Describe the issue

The production builds reference sourcemaps due to trailing comments.

bootstrap.bundle.min.js:

//# sourceMappingURL=bootstrap.bundle.min.js.map

bootstrap.min.css:

/*# sourceMappingURL=bootstrap.min.css.map */

That unfortunately spams the devtools console on every page load. Example from my dev machine::

Source map error: Error: request failed with status 404
Resource URL: http://localhost:80/bootstrap.min.css
Source Map URL: bootstrap.min.css.map

The production build should not have source map support, because it's unnecessary, it spams the console and generates significantly more traffic. (CDN-served assets also have sourcemaps in production builds.)

Reduced test cases

  • Reference minified css and js files, either from local sources or CDN
  • Open devtools console - errors
  • Measure traffic - much more traffic as those map files are huge

What operating system(s) are you seeing the problem on?

Linux, iOS, Android, Windows, macOS

What browser(s) are you seeing the problem on?

Firefox

What version of Bootstrap are you using?

v5.3.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions