← 返回首页
fix(webpack): restore source map files and always respect env.sourceMap by edusperoni · Pull Request #11303 · NativeScript/NativeScript · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

fix(webpack): restore source map files and always respect env.sourceMap#11303

Merged
NathanWalker merged 1 commit into
mainfrom
feat/restore-source-maps
Jul 8, 2026
Merged

fix(webpack): restore source map files and always respect env.sourceMap#11303
NathanWalker merged 1 commit into
mainfrom
feat/restore-source-maps

Conversation

Copy link
Copy Markdown
Contributor

PR Checklist

What is the current behavior?

For v9+ (ESM) dev builds, the webpack config called useSourceMapFiles(), which overwrote env.sourceMap with 'inline-source-map'. This had two problems:

  1. env.sourceMap was silently ignored. Since NativeScript 9, passing --env.sourceMap=<type> (e.g. source-map) on a dev build had no effect — the user's value was clobbered before getSourceMapType() ever saw it, so builds always emitted inline source maps regardless of what was requested.
  2. File (external) source maps were effectively lost. Everything was forced inline, even though the Android and iOS runtimes are capable of loading .map files.

What is the new behavior?

The clobbering of env.sourceMap is removed. Instead, the v9+ dev-build path only adjusts a local defaultSourceMap fallback (now 'source-map'), which is used solely when the user hasn't specified env.sourceMap:

  • env.sourceMap is always respected again. A user-provided --env.sourceMap=<type> (or =true/=false) now flows through getSourceMapType() unchanged, on both dev and production builds.
  • File source maps are restored as the default for v9+ dev builds, so the Android/iOS runtimes once again handle external .map files properly instead of everything being inlined.

edusperoni changed the title fix(webpack): restore source map files and always respect env.sourceMap` fix(webpack): restore source map files and always respect env.sourceMap Jul 8, 2026

nx-cloud Bot commented Jul 8, 2026
edited
Loading

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 3c9c69e

Command Status Duration Result
nx test apps-automated -c=android ✅ Succeeded 3m 44s View ↗
nx run-many --target=test --configuration=ci --... ✅ Succeeded <1s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗

☁️ Nx Cloud last updated this comment at 2026-07-08 13:21:41 UTC

Hide details View details NathanWalker merged commit 08a7f59 into main Jul 8, 2026
8 checks passed
NathanWalker deleted the feat/restore-source-maps branch July 8, 2026 18:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Footer

© 2026 GitHub, Inc.