LearnNewsExamplesServices
Frontmatter
id8762
titleWebpack: Migrate All Worker Builds to Native ESM Output
stateClosed
labels
aiarchitectureperformancebuild
assigneestobiu
createdAtJan 17, 2026, 7:01 PM
updatedAtJan 17, 2026, 7:22 PM
githubUrlhttps://github.com/neomjs/neo/issues/8762
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 17, 2026, 7:22 PM

Webpack: Migrate All Worker Builds to Native ESM Output

Closed v11.23.0 aiarchitectureperformancebuild
tobiu
tobiu commented on Jan 17, 2026, 7:01 PM

Description

Following the successful modernization of the Main Thread build (Ticket #8760), we are extending the Native ESM Output strategy to all Worker builds.

This is a significant architectural shift. By enabling experiments: { outputModule: true } and output.library: { type: 'module' } across the board, we are instructing Webpack to generate true ECMAScript Modules for all worker bundles (App, Data, VDom, etc.).

Benefits:

  1. Consistency: Unifies the build output format across the entire framework.
  2. Performance: Native ESM can be more efficient for browsers to parse and execute compared to Webpack's legacy wrapper boilerplate.
  3. Future-Proofing: Aligns the framework with modern web standards and prepares it for features like Top-Level Await (TLA) in workers.
  4. Simplified Chunk Loading: Enables publicPath: 'auto', allowing native import() to resolve chunks relative to the worker file, eliminating the need for manual path patching logic.

Scope

Apply the following changes to all development and production configurations for App Workers and generic Workers:

  • buildScripts/webpack/development/webpack.config.appworker.mjs
  • buildScripts/webpack/development/webpack.config.worker.mjs
  • buildScripts/webpack/production/webpack.config.appworker.mjs
  • buildScripts/webpack/production/webpack.config.worker.mjs

Changes Required

  1. Add experiments: { outputModule: true }.
  2. Set output.library: { type: 'module' }.
  3. Set output.publicPath: 'auto' (replacing empty string '').
  4. Ensure target remains webworker.

Acceptance Criteria

  • All worker bundles (appworker.js, dataworker.js, vdomworker.js, etc.) are generated as valid ES Modules.
  • Application boots and functions correctly in both Development and Production builds.
  • Dynamic imports inside workers resolve correctly.
tobiu added the ai label on Jan 17, 2026, 7:01 PM
tobiu added the architecture label on Jan 17, 2026, 7:01 PM
tobiu added the performance label on Jan 17, 2026, 7:01 PM
tobiu added the build label on Jan 17, 2026, 7:01 PM
tobiu referenced in commit d0dbefd - "feat: Migrate All Worker Builds to Native ESM Output (#8762)" on Jan 17, 2026, 7:21 PM
tobiu
tobiu Jan 17, 2026, 7:21 PM

Input from Gemini 3 Pro:

✦ I have migrated all Worker builds (App Worker and generic Workers) to use Native ESM Output in both Development and Production environments.

Changes Applied:

  • Enabled experiments: { outputModule: true } in all relevant Webpack configs.
  • Set output.library: { type: 'module' } to generate true ES modules.
  • Set output.publicPath: 'auto' to leverage native ESM chunk resolution.

Files Modified:

  • buildScripts/webpack/development/webpack.config.appworker.mjs
  • buildScripts/webpack/development/webpack.config.worker.mjs
  • buildScripts/webpack/production/webpack.config.appworker.mjs
  • buildScripts/webpack/production/webpack.config.worker.mjs

Verification:

  • User confirmed npm run build-all completes successfully.
  • User confirmed apps in dist environment launch and function correctly.

This completes the architectural shift to a unified, ESM-first build system for Neo.mjs.

tobiu assigned to @tobiu on Jan 17, 2026, 7:21 PM
tobiu closed this issue on Jan 17, 2026, 7:22 PM