Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow bundling from node.js or with new gulp task bundle-to-stdout #1570

Merged
merged 3 commits into from
Sep 11, 2017

Conversation

snapwich
Copy link
Collaborator

@snapwich snapwich commented Sep 7, 2017

Type of change

  • Feature

Description of change

Can be used in node.js like so:

var nodeBundle = require('./gulpfile.js');

nodeBundle(['rubiconBidAdapter', 'currency'])
  .then(output => console.log(output));  // string representation of prebid.js

Or can print the bundle to stdout like so:

gulp bundle-to-stdout --modules=rubiconBidAdapter,currency > prebid.js

Copy link
Collaborator

@matthewlane matthewlane left a comment

Choose a reason for hiding this comment

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

gulp build with this change results in
build/dist/prebid.js 62K

vs on master at 598817f
build/dist/prebid.js 338K

looks like all modules are getting included on master but not in the PR? To be expected?

@snapwich
Copy link
Collaborator Author

@matthewlane no, that is a bug. should be fixed now. good catch.

@matthewlane matthewlane merged commit 0d02f82 into prebid:master Sep 11, 2017
@korziee
Copy link

korziee commented May 29, 2018

Hey guys, sorry to comment here. We're trying to generate prebid bundles programmatically, and we're having any issue with the nodeBundle function, I did create an issue but it was never responded to.

When I run the following:

const nodeBundle = require('prebid.js/gulpfile.js')

nodeBundle(['rubiconBidAdapter'])
  .then((x) => {
    console.log(x);
  })
  .catch((e) => {
    console.error(e);
  })

All I get is some console messages and then it instantly exits the process.

kory-mbp:prebidTest kory$ node test.js
[09:48:29] Concatenating files:
 [ '/Users/kory/Publift/testing/prebidTest/node_modules/prebid.js/build/dist/prebid-core.js',
  '/Users/kory/Publift/testing/prebidTest/node_modules/prebid.js/build/dist/rubiconBidAdapter.js' ]
[09:48:29] Appending pbjs.processQueue();
[09:48:29] Generating bundle: prebid.js
(node:19939) ExperimentalWarning: The http2 module is an experimental API.

Nothing is built, or logged.

Node version: v8.11.2
NPM version: 5.6.0
OS: MacOS
Prebid Version: 1.12.0

Would really love some feedback on this, happy to submit a PR if given some direction. @snapwich

@robertrmartinez robertrmartinez deleted the node-bundle branch July 5, 2023 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants