babel-plugin-reactylon 1.2.0-alpha.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/ParserUtils.js +5 -4
- package/package.json +1 -1
package/build/ParserUtils.js
CHANGED
|
@@ -90,16 +90,17 @@ class ParserUtils {
|
|
|
90
90
|
* @returns an object containing the discovered exports and side effects maps
|
|
91
91
|
*/
|
|
92
92
|
static generateExportsAndSideEffects(moduleName) {
|
|
93
|
-
const
|
|
93
|
+
const resolveFrom = process.cwd();
|
|
94
|
+
const requireFromCaller = createRequire(path.join(resolveFrom, 'package.json'));
|
|
94
95
|
let pkgJsonPath;
|
|
95
96
|
try {
|
|
96
|
-
pkgJsonPath =
|
|
97
|
+
pkgJsonPath = requireFromCaller.resolve(`${moduleName}/package.json`);
|
|
97
98
|
}
|
|
98
99
|
catch (_a) {
|
|
99
|
-
console.error(`The module "${moduleName}" doesn't exist or cannot be resolved.`);
|
|
100
|
+
console.error(`The module "${moduleName}" doesn't exist or cannot be resolved from ${resolveFrom}.`);
|
|
100
101
|
return { exports: {}, sideEffects: {} };
|
|
101
102
|
}
|
|
102
|
-
const modulePath = path.dirname(pkgJsonPath);
|
|
103
|
+
const modulePath = fs.realpathSync(path.dirname(pkgJsonPath));
|
|
103
104
|
const exportsMap = {};
|
|
104
105
|
const sideEffectsMap = {};
|
|
105
106
|
this.scanDirectory(modulePath, exportsMap, sideEffectsMap, modulePath, moduleName);
|
package/package.json
CHANGED