We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 47bbb21 commit 73e1debCopy full SHA for 73e1deb
lib/utils.js
@@ -1,7 +1,7 @@
1
'use strict';
2
3
const getPackages = require('get-monorepo-packages');
4
-const { dirname, relative, sep, resolve, isAbsolute } = require('path');
+const { dirname, join, relative, sep, normalize, isAbsolute } = require('path');
5
6
const isSubPath = (parent, path) => {
7
const relativePath = relative(parent, path);
@@ -23,7 +23,7 @@ const packages = getPackages(process.cwd()).map(
23
const resolvePath = (parent, path) => {
24
if (path[0] !== '.') return path;
25
26
- return resolve(parent, path);
+ return join(parent, path).replace(/\\/g, '/');
27
};
28
29
const resolveImport = (context, node, { value, range }, currentPackage) => {
@@ -35,6 +35,8 @@ const resolveImport = (context, node, { value, range }, currentPackage) => {
35
const pathToImport = path => {
36
if (path === '') return '.';
37
38
+ path = normalize(path).replace(/\\/g, '/');
39
+
40
if (path[0] !== '.') return `./${path}`;
41
42
return path;
0 commit comments