babel-plugin-reactylon 1.1.1 → 1.2.0-aplpha.1

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.
@@ -99,7 +99,30 @@ class ParserUtils {
99
99
  console.error(`The module "${moduleName}" doesn't exist or cannot be resolved.`);
100
100
  return { exports: {}, sideEffects: {} };
101
101
  }
102
- const modulePath = fs.realpathSync(path.dirname(pkgJsonPath));
102
+ // MINIMAL: se è un symlink, scansiona la build in /dist
103
+ const pkgDir = path.dirname(pkgJsonPath); // non realpath qui
104
+ const isSymlink = (() => {
105
+ try {
106
+ return fs.lstatSync(pkgDir).isSymbolicLink();
107
+ }
108
+ catch (_a) {
109
+ return false;
110
+ }
111
+ })();
112
+ const realRoot = fs.realpathSync(pkgDir);
113
+ let modulePath = realRoot;
114
+ console.log(isSymlink, modulePath, realRoot);
115
+ if (isSymlink) {
116
+ const distPath = path.join(realRoot, 'dist');
117
+ if (fs.existsSync(distPath)) {
118
+ modulePath = distPath;
119
+ // opzionale: log utile in dev
120
+ console.warn(`[ParserUtils] ${moduleName} symlink rilevato → uso ${distPath}`);
121
+ }
122
+ else {
123
+ console.warn(`[ParserUtils] ${moduleName} symlink rilevato ma dist mancante → fallback a ${realRoot}`);
124
+ }
125
+ }
103
126
  const exportsMap = {};
104
127
  const sideEffectsMap = {};
105
128
  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.1.1",
3
+ "version": "1.2.0-aplpha.1",
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",