- **Phase 2: Rollup Bundler** — Each detected NPM package is fed to the Rollup build pipeline as an entry point. Rollup resolves entry points and discovers transitive dependencies automatically via `@rollup/plugin-node-resolve`. The externals configuration prevents shared dependencies from being duplicated (e.g., `react` is external to `react-dom`'s bundle). The plugin transformation chain converts code through CJS -> ESM -> tree-shaken ESM -> AMD (`sap.ui.define`). External references are remapped via `paths` so that the UI5 module loader can resolve them at runtime (e.g., `'react'` -> `'thirdparty/react'`). Packages are bundled in topological order so that dependencies are available before dependents. Output: optimized AMD modules (e.g., `react.js` 19KB, `react-dom.js` 577KB with AMD dependency on `thirdparty/react`).
0 commit comments