Prebid.js icon indicating copy to clipboard operation
Prebid.js copied to clipboard

Can't add new module

Open chensMMG opened this issue 9 years ago • 3 comments

I have some issues changing the code to the new version. I have performed the following steps:

  1. Open new file under modules folder with the name "marsmediaBidAdapter".
  2. Open new file under modules folder with the name "marsmediaAnalyticsAdapter".
  3. Open new file under test\spec\modules folder with the name "marsmediaBidAdapter_spec".
  4. Copy all adapters logic from the old version to the new ones ( mentioned above ) with some path changes.
  5. Running the command "gulp serve".

After running, I took the "prebid.js" file from the folder build\dev and put it in my test file (the same one that worked fine in version 0.25). When I loaded the test page, it seems that no adapter is loaded.

Then I tried to run the command "gulp serve --modules=marsmediaBidAdapter" and got this error: "Message: invalid modules: marsmediaBidAdapter"

Why all of the adapters don't load?

chensMMG avatar Jul 03 '17 14:07 chensMMG

If you search the build/dev/prebid.js file for your marsmediaBidAdapter source code, is it in there?

"My adapter's code isn't in the bundle" and "my adapter's code in the bundle isn't working" are two very different problems.

dbemiller avatar Jul 05 '17 15:07 dbemiller

I have found the slution in another issue, just need to replace the next line in gulpHelpers file: var moduleName = file.split(new RegExp('[.' + path.sep + ']'))[0];

to: var moduleName = file.split(new RegExp('[.\\' + path.sep + ']'))[0];

@dbemiller My adapter is working just not included in the bundle.

chensMMG avatar Jul 10 '17 08:07 chensMMG

aha, ok. Yeah, that issue was also fixed in #1332.

dbemiller avatar Jul 10 '17 12:07 dbemiller