Skip to content

fix(compiler): source map issues - #6971

Open
stephan-dum wants to merge 9 commits into
stenciljs:mainfrom
stephan-dum:feat/source-map-issues
Open

stephan-dum wants to merge 9 commits into
stenciljs:mainfrom
stephan-dum:feat/source-map-issues

Conversation

@stephan-dum

@stephan-dum stephan-dum commented Oct 22, 2026 •

Copy link
Copy Markdown

What is the current behavior?

  1. the source map sources paths are pointing to non existing files (missing ../../)
  2. the dist files contain multiple source map references where the first one is non existing

GitHub Issue Number: #6959

What is the new behavior?

1. source map paths are correct

by adding dir to all RollupOutputOptions the sourcemap.sources property is correct. This requires to loop all possible outputTargets (similar to collection and customElements output targets)

the dir for system output targets was pointing to esmDir which uses now systemDir instead.

es5 builds now are in there own directory using esmEs5Dir

2. only one referenced source map per file

es5 ts.transpileModule added a source map reference for module.ts which is remove now.

minify options format.comments is now applied to all targets. There seams to be an inconsistency with sourcemap reference comment when this option is set it will not remove the reference comment. This means there is no need anymore for the getSourceMappingUrlForEndOfFile function so its completly removed.

lazyBundleIdPlugin function is also removed to keep naming of source map reference and the actual source file in sync. This should be already covered by template strings:

chunkFileNames: config.hashFileNames ? 'p-[hash].js' : '[name]-[hash].js',
assetFileNames: config.hashFileNames ? 'p-[hash][extname]' : '[name]-[hash][extname]',

Does this introduce a breaking change?

  • Yes
  • No

Testing

All unit tests are passing
Added new e2e test cases to prevent it in the future

@stephan-dum
stephan-dum marked this pull request as ready for review October 23, 2026 01:53
@stephan-dum
stephan-dum requested a review from a team as a code owner October 23, 2026 01:53
@stephan-dum stephan-dum changed the title fix/source map issues fix(compiler): source map issues Oct 24, 2026

This branch has not been deployed

No deployments
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.

2 participants