Skip to content

Core: Support build options in non-Webpack bundlers#14649

Merged
patmmccann merged 8 commits intoprebid:masterfrom
marco-prontera:feat/#14639
Apr 13, 2026
Merged

Core: Support build options in non-Webpack bundlers#14649
patmmccann merged 8 commits intoprebid:masterfrom
marco-prontera:feat/#14639

Conversation

@marco-prontera
Copy link
Copy Markdown
Contributor

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

Copilot AI review requested due to automatic review settings March 26, 2026 14:38
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 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".

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 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".

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

@marco-prontera
Copy link
Copy Markdown
Contributor Author

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

@patmmccann
Copy link
Copy Markdown
Collaborator

Does this produce a smaller bundle?

@marco-prontera
Copy link
Copy Markdown
Contributor Author

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.

@dgirardi
Copy link
Copy Markdown
Collaborator

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

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.

Copy link
Copy Markdown
Collaborator

@dgirardi dgirardi left a comment

Choose a reason for hiding this comment

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

Test failures on Windows look unrelated and should be fixed by #14656

@marco-prontera
Copy link
Copy Markdown
Contributor Author

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

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.

@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented Apr 2, 2026

Pull Request Test Coverage Report for Build 23909103476

Warning: 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

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 96.337%

Totals Coverage Status
Change from base Build 23906945880: 0.0%
Covered Lines: 216764
Relevant Lines: 225005

💛 - Coveralls

@patmmccann patmmccann changed the title Support build options in non-Webpack bundlers Core: Support build options in non-Webpack bundlers Apr 13, 2026
@patmmccann patmmccann merged commit c364b23 into prebid:master Apr 13, 2026
102 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support build options in non-Webpack bundlers

5 participants