tailwind-hyperclay 0.1.13 → 0.1.14
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/CHANGELOG.md +7 -0
- package/index.js +5 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/index.js
CHANGED
|
@@ -54,7 +54,8 @@ async function compileTailwind(html) {
|
|
|
54
54
|
// Determine base path for module resolution
|
|
55
55
|
// - In packaged Electron apps: use app.asar.unpacked/node_modules
|
|
56
56
|
// - In Electron dev mode or Node.js: use parent of __dirname (node_modules)
|
|
57
|
-
let defaultBase = path.join(__dirname, '..'); // Default: node_modules directory
|
|
57
|
+
let defaultBase = path.join(__dirname, '..'); // Default: node_modules directory (when installed as a dep)
|
|
58
|
+
const ownBase = __dirname; // Fallback: resolve from own node_modules (when running from repo)
|
|
58
59
|
|
|
59
60
|
if (process.versions.electron && process.resourcesPath) {
|
|
60
61
|
const asarUnpackedPath = path.join(process.resourcesPath, 'app.asar.unpacked', 'node_modules');
|
|
@@ -70,7 +71,7 @@ async function compileTailwind(html) {
|
|
|
70
71
|
const compiler = await compile(inputCSS, {
|
|
71
72
|
loadStylesheet: async (id, base) => {
|
|
72
73
|
let resolved;
|
|
73
|
-
const searchPaths = [base || defaultBase];
|
|
74
|
+
const searchPaths = [base || defaultBase, ownBase];
|
|
74
75
|
|
|
75
76
|
// Try resolving as-is first (for .css files)
|
|
76
77
|
try {
|
|
@@ -93,13 +94,12 @@ async function compileTailwind(html) {
|
|
|
93
94
|
return { content, base: path.dirname(resolved) };
|
|
94
95
|
},
|
|
95
96
|
loadModule: async (id, base) => {
|
|
96
|
-
const resolved = require.resolve(id, { paths: [base || defaultBase] });
|
|
97
|
+
const resolved = require.resolve(id, { paths: [base || defaultBase, ownBase] });
|
|
97
98
|
const mod = require(resolved);
|
|
98
99
|
return { module: mod.default || mod, base: path.dirname(resolved) };
|
|
99
100
|
},
|
|
100
101
|
loadPlugin: async (plugin) => {
|
|
101
|
-
|
|
102
|
-
const resolved = require.resolve(plugin, { paths: [defaultBase] });
|
|
102
|
+
const resolved = require.resolve(plugin, { paths: [defaultBase, ownBase] });
|
|
103
103
|
const mod = require(resolved);
|
|
104
104
|
return mod.default || mod;
|
|
105
105
|
}
|