@plumeria/compiler 0.18.2 → 0.18.4
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/dist/index.js +21 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -46,16 +46,28 @@ else {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
let coreFilePath;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
const coreSourcePackageJsonPath = path.join(process.cwd(), 'package.json');
|
|
50
|
+
const coreSourcePackageJson = JSON.parse(fs.readFileSync(coreSourcePackageJsonPath, 'utf-8'));
|
|
51
|
+
const dependencies = {
|
|
52
|
+
...coreSourcePackageJson.dependencies,
|
|
53
|
+
...coreSourcePackageJson.devDependencies,
|
|
54
|
+
};
|
|
55
|
+
const coreVersion = dependencies['@plumeria/core'];
|
|
56
|
+
const resolvedCorePackageJsonPath = require.resolve('@plumeria/core/package.json', {
|
|
57
|
+
paths: [projectRoot, process.cwd()],
|
|
58
|
+
});
|
|
59
|
+
if (workspaceRootFile) {
|
|
60
|
+
if (coreVersion.includes('workspace')) {
|
|
61
|
+
coreFilePath = path.join(path.dirname(resolvedCorePackageJsonPath), 'stylesheet.css');
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
const corePackageJson = JSON.parse(fs.readFileSync(resolvedCorePackageJsonPath, 'utf-8'));
|
|
65
|
+
const exactCoreVersion = corePackageJson.version;
|
|
66
|
+
coreFilePath = path.join(projectRoot, 'node_modules', '.pnpm', `@plumeria+core@${exactCoreVersion}`, 'node_modules', '@plumeria', 'core', 'stylesheet.css');
|
|
67
|
+
}
|
|
54
68
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
error);
|
|
58
|
-
process.exit(1);
|
|
69
|
+
else {
|
|
70
|
+
coreFilePath = path.join(path.dirname(resolvedCorePackageJsonPath), 'stylesheet.css');
|
|
59
71
|
}
|
|
60
72
|
const cleanUp = async () => {
|
|
61
73
|
if (process.env.CI && existsSync(coreFilePath)) {
|