tailwind-hyperclay 0.1.3 → 0.1.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/index.js +8 -4
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -34,13 +34,17 @@ export async function compileTailwind(html) {
|
|
|
34
34
|
try {
|
|
35
35
|
resolved = require.resolve(id, { paths: searchPaths });
|
|
36
36
|
} catch {
|
|
37
|
-
// If that fails, try
|
|
38
|
-
|
|
37
|
+
// If that fails, try resolving the package main entry and construct path to index.css
|
|
38
|
+
// This avoids subpath exports which can fail in Electron asar bundles
|
|
39
|
+
const mainEntry = require.resolve(id, { paths: searchPaths });
|
|
40
|
+
const pkgRoot = path.resolve(path.dirname(mainEntry), '..');
|
|
41
|
+
resolved = path.join(pkgRoot, 'index.css');
|
|
39
42
|
}
|
|
40
43
|
|
|
41
|
-
// If resolved to a JS file,
|
|
44
|
+
// If resolved to a JS file, find package root and use index.css
|
|
42
45
|
if (resolved.endsWith('.js') || resolved.endsWith('.mjs')) {
|
|
43
|
-
|
|
46
|
+
const pkgRoot = path.resolve(path.dirname(resolved), '..');
|
|
47
|
+
resolved = path.join(pkgRoot, 'index.css');
|
|
44
48
|
}
|
|
45
49
|
|
|
46
50
|
const content = await readFile(resolved, 'utf-8');
|