babel-plugin-reactylon 1.2.0-alpha.0 → 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.
- package/build/ParserUtils.js +24 -1
- package/package.json +1 -1
package/build/ParserUtils.js
CHANGED
|
@@ -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
|
-
|
|
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