Skip to content

Commit

Permalink
add logic to prefer prebid modules over external modules in build pro…
Browse files Browse the repository at this point in the history
…cess (prebid#4124)

* add check in getModules helper function

* update logic based on feedback

* update node version of project
  • Loading branch information
jsnellbaker authored and sa1omon committed Nov 28, 2019
1 parent a7f9409 commit 264c2d4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
build:
docker:
# specify the version you desire here
- image: circleci/node:7.10
- image: circleci/node:8.9.0

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ module.exports = {
}
```

Or for Babel 6 and/or Node v8.6.0 and less:
Or for Babel 6:
```javascript
// you must manually install and specify the presets and plugins yourself
options: {
Expand Down Expand Up @@ -112,7 +112,7 @@ prebid.requestBids({
$ cd Prebid.js
$ npm install

*Note:* You need to have `NodeJS` 6.x or greater installed.
*Note:* You need to have `NodeJS` 8.9.x or greater installed.

*Note:* In the 1.24.0 release of Prebid.js we have transitioned to using gulp 4.0 from using gulp 3.9.1. To compily with gulp's recommended setup for 4.0, you'll need to have `gulp-cli` installed globally prior to running the general `npm install`. This shouldn't impact any other projects you may work on that use an earlier version of gulp in it's setup.

Expand Down
5 changes: 4 additions & 1 deletion gulpHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ module.exports = {
}
return Object.assign(externalModules.reduce((memo, module) => {
try {
var modulePath = require.resolve(module);
// prefer internal project modules before looking at project dependencies
var modulePath = require.resolve(module, {paths: ['./modules']});
if (modulePath === '') modulePath = require.resolve(module);

memo[modulePath] = module;
} catch (err) {
// do something
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"author": "the prebid.js contributors",
"license": "Apache-2.0",
"engines": {
"node": ">=4.0"
"node": ">=8.9.0"
},
"devDependencies": {
"@babel/core": "^7.2.2",
Expand Down

0 comments on commit 264c2d4

Please sign in to comment.