Core: Support build options in non-Webpack bundlers#14649
Core: Support build options in non-Webpack bundlers#14649patmmccann merged 8 commits intoprebid:masterfrom
Conversation
…available at built time
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9fb437e4e0
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9fb437e4e0
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
This PR expands Prebid.js build-time customization so the same build options override protocol works beyond Webpack, enabling Rollup/Vite/Rolldown builds to replace the generated build options module consistently.
Changes:
- Refactors the existing webpack loader to use a shared “virtual build options module” helper.
- Adds a Rollup-compatible plugin that intercepts the generated build options module and returns a virtual module payload.
- Adds/updates documentation to describe both integration paths and the shared helper.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| customize/webpackLoader.mjs | Switches webpack loader implementation to the shared virtual-module helper. |
| customize/virtualBuildOptions.mjs | Introduces shared helpers for identifying/rendering the virtual build options module. |
| customize/rollupPlugin.mjs | Adds Rollup/Vite-compatible plugin to intercept and virtualize the build options module. |
| customize/README.md | Documents how to customize build options via webpack loader or Rollup plugin. |
| README.md | Updates top-level docs to point to the new customization documentation and mention Rollup support. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hi @dgirardi, if you want, I can introduce E2E Build Test to simulate prebid.js developers using webpack, rollup based projects so this kind of thing can be under test. I don't know how "easy" it is to do this but we can try |
|
Does this produce a smaller bundle? |
In my use, I found a lighter bundle, without the webpack glue code, and a more effective three-shaking. This then depends on the type of setup and architecture you build around, and how you intend to consume the bundle you're using. |
This is not trivial at the moment but I won't stop you if you want to attempt it. For reference I pushed some work in progress doing this for webpack, where the pieces are:
if vite/rollup can work as a drop in replacement for webpack then I expect it would be enough to know its minimal config, the right dependencies and bundling command, which would be very helpful even if you don't get the whole e2e flow running. |
Thanks so much! I'll try it out and try opening another pull request for E2E build testing. |
Pull Request Test Coverage Report for Build 23909103476Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Type of change
Bugfix
Feature
New bidder adapter
Updated bidder adapter
Code style update (formatting, local variables)
Refactoring (no functional changes, no api changes)
Build related changes
CI related changes
Does this change affect user-facing APIs or examples documented on http://prebid.org?
Other
Description of change
The goal of this PR is to expand and standardize the customization options for Prebid.js build parameters.
Currently, certain build-time parameters can only be customized through a specific Webpack loader.
This PR introduces a Rollup-based plugin that standardizes this process by adopting the same protocol used by the Webpack loader. By leveraging the existing virtual file concept, we can now automatically support a much wider range of bundlers.
Other information
closes #14639