Skip to content

Commit 3f556dc

Browse files
jsnellbakerbretg
authored andcommitted
add logic to prefer prebid modules over external modules in build process (#4124)
* add check in getModules helper function * update logic based on feedback * update node version of project
1 parent eaffc3d commit 3f556dc

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
build:
88
docker:
99
# specify the version you desire here
10-
- image: circleci/node:7.10
10+
- image: circleci/node:8.9.0
1111

1212
# Specify service dependencies here if necessary
1313
# CircleCI maintains a library of pre-built images

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ module.exports = {
6666
}
6767
```
6868

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

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

117117
*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.
118118

gulpHelpers.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,10 @@ module.exports = {
9191
}
9292
return Object.assign(externalModules.reduce((memo, module) => {
9393
try {
94-
var modulePath = require.resolve(module);
94+
// prefer internal project modules before looking at project dependencies
95+
var modulePath = require.resolve(module, {paths: ['./modules']});
96+
if (modulePath === '') modulePath = require.resolve(module);
97+
9598
memo[modulePath] = module;
9699
} catch (err) {
97100
// do something

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"author": "the prebid.js contributors",
2222
"license": "Apache-2.0",
2323
"engines": {
24-
"node": ">=4.0"
24+
"node": ">=8.9.0"
2525
},
2626
"devDependencies": {
2727
"@babel/core": "^7.2.2",

0 commit comments

Comments
 (0)