Skip to content

Commit

Permalink
[FIX] bundle/Builder: Add missing 'names' attribute to generated sour…
Browse files Browse the repository at this point in the history
…ce maps

For source maps generated in the bundler (so called "transient" source
maps), also declare the non-optional 'names' array attribute as per
spec: https://tc39.es/source-map-spec/#names
  • Loading branch information
RandomByte committed Oct 11, 2023
1 parent 4f54a62 commit 57e0e50
Show file tree
Hide file tree
Showing 65 changed files with 82 additions and 71 deletions.
1 change: 1 addition & 0 deletions lib/lbt/bundle/Builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,7 @@ async function transform(changes, moduleContent, moduleSourceMap) {
function createTransientSourceMap({moduleName, moduleContent, includeContent = false}) {
const sourceMap = {
version: 3,
names: [],
sources: [moduleName],
// TODO: check whether moduleContent.match() with \n is better w.r.t performance/memory usage
mappings: encodeMappings(moduleContent.split("\n").map((line, i) => {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 57e0e50

Please sign in to comment.