Skip to content

Commit 16d714e

Browse files
author
Karolis Šarapnickis
authored
Merge pull request #61 from karolis-sh/fix/win-2
fix: resolve windows resource loading issue
2 parents c611adc + 7983b9b commit 16d714e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/electron-snowpack/lib/snowpack-plugin-relative-proxy-imports.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,15 @@ module.exports = () => {
3434
await Promise.all(
3535
proxies.map(async (filePath) => {
3636
const firstLine = await readFirstLine(filePath);
37-
const relativeProxyImport = path.relative(buildDirectory, filePath);
37+
const relativeProxyImport = path
38+
.relative(buildDirectory, filePath)
39+
.split(path.sep)
40+
.join(path.posix.sep);
3841
const relativeImport = relativeProxyImport.substring(
3942
0,
4043
relativeProxyImport.length - PROXY_SUFFIX.length
4144
);
42-
if (firstLine === `export default "${path.join('/', relativeImport)}";`) {
45+
if (firstLine === `export default "/${relativeImport}";`) {
4346
await writeFirstLine(filePath, `export default "${relativeImport}";`);
4447
}
4548
})

0 commit comments

Comments
 (0)