Skip to content

Conversation

@NathanWalker
Copy link
Contributor

What is the current behavior?

Projects by default would bundle to commonjs output always.

What is the new behavior?

With new v9 runtimes, es modules are natively supported.
Projects will now default to es module output when runtime version v9+ is detected otherwise falls back to commonjs. Allows flag --env.commonjs to be used anytime for explicit commonjs bundling if needed for any reason with v9+ as well.
Fully backwards compatible.

@NathanWalker NathanWalker added this to the 9.0 milestone Aug 30, 2025
@nx-cloud
Copy link

nx-cloud bot commented Aug 30, 2025

View your CI Pipeline Execution ↗ for commit 5320da1

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

☁️ Nx Cloud last updated this comment at 2025-09-18 20:12:09 UTC

// appears to be working - but we still have to deal with HMR
config.target('node');

// config.entry('globals').add('@nativescript/core/globals/index').end();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This entry doesn't appear to make a difference (in commonjs or esm bundling), can probably remove.
Unless this was here for some other reason @rigor789 ?

This now works with any bundler so renaming for clarity.
Also removed legacy _isModuleLoadedForUI as was no longer used.
Defaults to es module output when runtime version v9+ is detected otherwise falls back to commonjs. Allows flag `--env.commonjs` to be used anytime for explicit commonjs bundling if needed for any reason with v9+.
@NathanWalker NathanWalker force-pushed the feat/webpack-es-module-support branch from 3c299a5 to 68832a7 Compare September 2, 2025 20:57
@NathanWalker NathanWalker merged commit 1e54baf into main Sep 18, 2025
6 of 7 checks passed
@NathanWalker NathanWalker deleted the feat/webpack-es-module-support branch September 18, 2025 20:03
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