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
Copy link

nx-cloud bot commented Aug 30, 2025

View your CI Pipeline Execution ↗ for commit 742a7c3

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

☁️ Nx Cloud last updated this comment at 2025-09-02 21:38:44 UTC

@@ -98,6 +180,8 @@ export default function (config: Config, env: IWebpackEnv = _env): Config {
// 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
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.

1 participant