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.
@@ -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 requireFromHere = createRequire(import.meta.url);
93
+ const resolveFrom = process.cwd();
94
+ const requireFromCaller = createRequire(path.join(resolveFrom, 'package.json'));
94
95
  let pkgJsonPath;
95
96
  try {
96
- pkgJsonPath = requireFromHere.resolve(`${moduleName}/package.json`);
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "babel-plugin-reactylon",
3
- "version": "1.2.0-alpha.0",
3
+ "version": "1.2.0",
4
4
  "description": "Babel plugin to enable tree-shaking of Babylon.js classes within a Reactylon application.",
5
5
  "main": "build/index.js",
6
6
  "type": "module",