Skip to content

Conversation

@nenadvicentic
Copy link
Contributor

Fixes issue with ES module source maps, after conversion to AMD. Described here #1214.

@3cp
Copy link
Member

3cp commented Aug 4, 2025

Thx!

@3cp 3cp merged commit 7195078 into aurelia:master Aug 4, 2025
7 checks passed
@3cp
Copy link
Member

3cp commented Aug 4, 2025

@bigpon pls release a patch version. Thx!

@bigopon
Copy link
Member

bigopon commented Aug 6, 2025

3.0.6 has been published, thanks @nenadvicentic @3cp 🙏

@nenadvicentic
Copy link
Contributor Author

nenadvicentic commented Aug 6, 2025

@bigopon @3cp Thank you both!

I just updated one of my projects to CLI 3.0.6. Works like charm.!You can see in the screenshot:

ESM-to-AMD-source-map

Only, I noticed another small thing. When I disable cache in aurelia.json -> build.options.cache: false I get new, correct source map (see screenshot). However, when I switch it back to default value "dev & stage", I, again, get previous, broken source map. Source file did not change, only tsconfig.json, so it makes sense to some extent. Can you remember from the top of your head - how long is cache valid for the project?

UPDATE:
Ah, I get it now. Source map has to be added to the cache too:

// write cache
if (useCache && hash) {
Utils.setCache(hash, {
deps: deps,
contents: this.contents
});
}

And treated in a similar way as content is treated:

get sourceMap() {
return this.file.sourceMap;
}

get contents() {
return this._contents === null
? (this._contents = this.file.contents.toString())
: this._contents;
}

I can adopt this in a new pull request.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants