Add Windows cross-platform support for npm scripts#204
Open
ExactDoug wants to merge 1 commit intomb21:masterfrom
Open
Add Windows cross-platform support for npm scripts#204ExactDoug wants to merge 1 commit intomb21:masterfrom
ExactDoug wants to merge 1 commit intomb21:masterfrom
Conversation
The current npm scripts use Unix-specific syntax that fails on Windows: - Environment variables use Unix syntax (VAR=value) instead of cross-platform - The postinstall script uses Unix 'cp' command which doesn't exist on Windows - Windows developers cannot run npm scripts natively without WSL This change adds proper cross-platform support: 1. Added 'cross-env' dependency (v7.0.3) - Handles environment variable setting across all platforms - Used in: build, electron:dev, website:build scripts 2. Added 'shx' dependency (v0.3.4) - Provides Unix commands (like cp) on all platforms - Used in: postinstall script These are industry-standard packages for Node.js cross-platform compatibility. Scripts updated: - build: Added cross-env for INLINE_RUNTIME_CHUNK - postinstall: Changed cp to shx cp for cross-platform file copying - electron:dev: Added cross-env for BROWSER and ELECTRON_IS_DEV - website:build: Added cross-env for BUILD_PATH, PUBLIC_URL, INLINE_RUNTIME_CHUNK This fixes the issues reported in PR mb21#65 and allows Windows developers to run all npm scripts without modification.
Owner
|
Did you test this on Windows yourself? And did you also test it on any other OS? |
Author
yes. I am only using Windows. But no. I did not test it on any other OS. |
Owner
|
Thanks for the answer. I'm inclined to say Windows devs should just use WSL. I don't have a Windows machine ready to test to properly maintain this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The current npm scripts use Unix-specific syntax that fails on Windows:
This change adds proper cross-platform support:
Added 'cross-env' dependency (v7.0.3)
Added 'shx' dependency (v0.3.4)
These are industry-standard packages for Node.js cross-platform compatibility.
Scripts updated:
This fixes the issues reported in PR #65 and allows Windows developers to run all npm scripts without modification.