registry-js icon indicating copy to clipboard operation
registry-js copied to clipboard

Skip build on platforms other than Windows

Open vweevers opened this issue 3 years ago • 1 comments

Necessary when dependents are cross-platform. The alternatives are setting "os" in package.json (which only works for yarn, not npm), using optionalDependencies in dependents (which would unfortunately ignore legit build failures), or building a dummy native addon (which is the current approach but it requires users to have an otherwise unnecessary build toolchain).

This simple solution works for both yarn and npm. Also accounts for cross-compiling scenarios (when process.platform does not match the target platform) by checking env.npm_config_platform.

vweevers avatar Sep 19 '20 10:09 vweevers

@sergiou87 This solution looks sleek, though I didn't verify. Would you consider to approve it for a rc build?

lotuswood avatar Oct 17 '21 10:10 lotuswood