@meowlynxsea/koi 0.2.16 → 0.2.17
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/package.json +1 -1
- package/scripts/postinstall.ts +13 -0
package/package.json
CHANGED
package/scripts/postinstall.ts
CHANGED
|
@@ -117,3 +117,16 @@ if (existsSync(indexHmk8xzt3Path)) {
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
console.log("\nPostinstall complete.");
|
|
120
|
+
|
|
121
|
+
// Fix main.js: replace scoped package imports with relative paths for Windows compatibility
|
|
122
|
+
const mainJsPath = join(rootDir, "dist", "main.js");
|
|
123
|
+
if (existsSync(mainJsPath)) {
|
|
124
|
+
let content = readFileSync(mainJsPath, "utf-8");
|
|
125
|
+
// Replace: import(`@opentui/core-${platform}-${arch}/index.js`)
|
|
126
|
+
// With: import(`./node_modules/@opentui/core-${platform}-${arch}/index.js`)
|
|
127
|
+
if (content.includes("`@opentui/core-")) {
|
|
128
|
+
content = content.replace(/`@opentui\/core-/g, "`./node_modules/@opentui/core-");
|
|
129
|
+
writeFileSync(mainJsPath, content);
|
|
130
|
+
console.log("Fixed dynamic imports in main.js for Windows compatibility");
|
|
131
|
+
}
|
|
132
|
+
}
|