Commit 36ace43
committed
Add Windows cross-platform support for npm scripts
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.1 parent 5a102eb commit 36ace43
1 file changed
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
| 10 | + | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| 168 | + | |
168 | 169 | | |
169 | 170 | | |
170 | 171 | | |
| 172 | + | |
171 | 173 | | |
172 | 174 | | |
173 | 175 | | |
| |||
0 commit comments