Skip to content

Commit

Permalink
Merge branch 'master' into TIMOB-18421
Browse files Browse the repository at this point in the history
  • Loading branch information
lokeshchdhry committed Apr 22, 2019
2 parents fdad582 + 52e352b commit 08091fb
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 44 deletions.
10 changes: 4 additions & 6 deletions android/runtime/common/src/js/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ Module.prototype.load = function (filename, source) {

this.filename = filename;
this.path = path.dirname(filename);
this.paths = this.nodeModulesPaths(this.path);

if (!source) {
source = assets.readAsset('Resources' + filename);
Expand Down Expand Up @@ -279,7 +280,7 @@ Module.prototype.require = function (request, context) {

// Allow looking through node_modules
// 3. LOAD_NODE_MODULES(X, dirname(Y))
loaded = this.loadNodeModules(request, this.path, context);
loaded = this.loadNodeModules(request, this.paths, context);
if (loaded) {
return loaded.exports;
}
Expand Down Expand Up @@ -349,18 +350,15 @@ Module.prototype.loadCoreModule = function (id, context) {
/**
* Attempts to load a node module by id from the starting path
* @param {String} moduleId The path of the module to load.
* @param {String} startDir The starting directory
* @param {String[]} dirs paths to search
* @param {Object} context context object
* @return {Object} The module's exports, if loaded. null if not.
*/
Module.prototype.loadNodeModules = function (moduleId, startDir, context) {
Module.prototype.loadNodeModules = function (moduleId, dirs, context) {
var mod, // the loaded module
dirs = [],
i,
dir;

// 1. let DIRS=NODE_MODULES_PATHS(START)
dirs = this.nodeModulesPaths(startDir);
// 2. for each DIR in DIRS:
for (i = 0; i < dirs.length; i++) {
dir = dirs[i];
Expand Down
56 changes: 21 additions & 35 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@
"@commitlint/config-conventional": "^7.5.0",
"@seadub/danger-plugin-dependencies": "0.1.0",
"@seadub/danger-plugin-eslint": "^1.0.0",
"@seadub/danger-plugin-junit": "0.0.2",
"@seadub/danger-plugin-junit": "0.1.1",
"clang-format": "1.2.3",
"commander": "^2.20.0",
"commitizen": "^3.0.7",
"commitizen": "^3.1.1",
"cz-conventional-changelog": "^2.1.0",
"danger": "^7.1.2",
"eslint-config-axway": "^4.2.2",
Expand All @@ -116,7 +116,7 @@
"js-yaml": "^3.13.1",
"lint-staged": "^8.1.5",
"pagedown": "~1.1.0",
"rollup": "^1.9.0",
"rollup": "^1.10.1",
"rollup-plugin-babel": "^4.3.2",
"rollup-plugin-commonjs": "^9.3.4",
"rollup-plugin-node-resolve": "^4.2.1",
Expand Down

0 comments on commit 08091fb

Please sign in to comment.