interledger / web-monetization-extension

An open-source browser extension that enables Web Monetization.
Apache License 2.0
76 stars 6 forks source link

[BUG] Fix extension build windows environment #711

Closed DarianM closed 1 week ago

DarianM commented 2 weeks ago

Steps to reproduce

  1. Run the esbuild build process on a Windows machine.
  2. Observe that the copy plugin fails to copy the files correctly in either production or development build dirs

Expected result

The copy plugin should be able to copy all the files correctly, regardless of the operating system (Windows, Linux, or macOS).

Actual result

When using the copy plugin from the esbuild-plugin-copy package on Windows, the file paths are not being correctly interpreted, leading to the plugin failing to copy the files.

Different file path conventions between Windows and other operating systems like Linux and macOS. On Windows, file paths typically use backslashes ( \ ) as the directory separator, while on Linux and macOS, the standard directory separator is a forward slash ( / ).

The copy plugin from the esbuild-plugin-copy package is designed to work with file paths using forward slashes, as this is the standard convention for file paths in js and most modern web development tools. When you use backslashes on Windows, the copy plugin is unable to properly interpret the file paths, leading to this issue.

Screenshots or videos

image

Additional context

To resolve this problem on Windows, we need to convert the backslashes to forward slashes in the from and to paths passed to the copy plugin.

Operating system

Windows, Linux

Operating system version

No response

Browsers

Firefox

Browser version

No response

Extension version

0.1.0