Skip to content
This repository was archived by the owner on Dec 4, 2022. It is now read-only.

Commit 0cc9e9f

Browse files
authored
avoid recognizing any require/import starts with "." as a custom-resolve-module on Windows (#114)
1 parent 24b78d2 commit 0cc9e9f

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [unreleased]
99

10+
## [2.1.2-dev.1] - 2019-09-20
11+
12+
- avoid recognizing any require/import starts with `.` as a custom-resolve-module on Windows
13+
1014
## [2.1.1] - 2019-08-14
1115

1216
- remove angular dependencies. use typescript compiler to parse Angular Decorators

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bit-javascript",
3-
"version": "2.1.1",
3+
"version": "2.1.2-dev.1",
44
"scripts": {
55
"flow": "flow; test $? -eq 0 -o $? -eq 2",
66
"lint": "eslint src && flow check || true",

src/dependency-builder/filing-cabinet/index.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -294,12 +294,7 @@ function commonJSLookup(options: Options) {
294294

295295
appModulePath.addPath(moduleLookupDir);
296296

297-
// Make sure the partial is being resolved to the filename's context
298-
// 3rd party modules will not be relative
299297
let partial = options.partial;
300-
if (partial[0] === '.') {
301-
partial = path.resolve(path.dirname(filename), partial);
302-
}
303298

304299
let result = '';
305300

@@ -314,6 +309,12 @@ function commonJSLookup(options: Options) {
314309
debug('failed resolved using resolveConfig, fall back to the standard resolver');
315310
}
316311

312+
// Make sure the partial is being resolved to the filename's context
313+
// 3rd party modules will not be relative
314+
if (partial[0] === '.') {
315+
partial = path.resolve(path.dirname(filename), partial);
316+
}
317+
317318
try {
318319
result = resolve.sync(partial, {
319320
extensions: resolveExtensions,

0 commit comments

Comments
 (0)