prebid / Prebid.js

Setup and manage header bidding advertising partners without writing code or confusing line items. Prebid.js is open source and free.
https://docs.prebid.org
Apache License 2.0
1.28k stars 2.05k forks source link

custom prebid.js bundle generation from CLI #420

Closed mhipszki closed 8 years ago

mhipszki commented 8 years ago

Hey guys,

we're integrating header bidding into our site currently and we've found prebid.js as a really nice and simple way to add this feature.

However we couldn't figure the best way to actually include the prebid bundle into our project.

We're considering:

We'd prefer to explicitly show to our devs that we're using prebid.js (in our package.json) and to build our custom bundle from source rather than to check in a downloaded version. We also need to automate the building of the bundle, containing only the adapters we need.

The issue is that we couldn't find a way to build the custom bundle with the selected adaptors with the provided gulp tasks, apart from hacking the project's package.json which is kind of an unmaintainable solution.

Separating the build related configuration first would probably make sense, but to make the build process "context independent", reproducible and simple it'd be great to see an option e.g. on the gulp task to specify an external config file e.g.

$ gulp build --config path/to/build-config.json

where build-config.json would contain e.g. the adapters

{
  "adapters": [
    "aardvark",
    "adequant",
    "adform",
    "admedia",
    "aol",
    "appnexus"
  ]
}

also, it'd be great to specify the build target path e.g.

$ gulp build --config path/to/build-config.json --target path/to/build/folder

We're happy to fork the project and provide the feature in a PR as others might utilise it as well.

mkendall07 commented 8 years ago

@mhipszki I think this is a useful feature. Happy to review a PR for this! Thanks

mhipszki commented 8 years ago

@mkendall07 awesome, I'll submit a PR soon then!

mhipszki commented 8 years ago

so, here's the PR, however I slightly changed (reduced) the scope

@mkendall07 could you please take a closer look and let me know if it complies with prebid.js standards?

I've tried to separate the solution as much as I could, also described how to use the feature in README.

mkendall07 commented 8 years ago

this is merged.