From faa9520db2477ef660ac051bdf1dc920981c06be Mon Sep 17 00:00:00 2001 From: Mint Thompson Date: Mon, 1 Apr 2024 13:14:10 -0400 Subject: [PATCH] Add variations on start and build scripts for Windows systems (#155) * Add variations on start and build scripts for Windows systems These scripts set an environment variable before invoking react-app-rewired. The syntax for doing this is different on Windows systems. Two new scripts are defined to make these actions available to Windows users. * Use cross-env to support start and build tasks on Mac, Windows, and Linux --------- Co-authored-by: Chris Moesel --- package-lock.json | 28 ++++++++++++++++++++++++++++ package.json | 5 +++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index e17c94c..8a4ac33 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,6 +32,7 @@ }, "devDependencies": { "cors": "^2.8.5", + "cross-env": "^7.0.3", "eslint-config-prettier": "^6.11.0", "eslint-plugin-prettier": "^3.1.3", "express": "^4.18.2", @@ -6466,6 +6467,24 @@ "sha.js": "^2.4.8" } }, + "node_modules/cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.1" + }, + "bin": { + "cross-env": "src/bin/cross-env.js", + "cross-env-shell": "src/bin/cross-env-shell.js" + }, + "engines": { + "node": ">=10.14", + "npm": ">=6", + "yarn": ">=1" + } + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -28896,6 +28915,15 @@ "sha.js": "^2.4.8" } }, + "cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.1" + } + }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", diff --git a/package.json b/package.json index 6a22231..1092bda 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ }, "devDependencies": { "cors": "^2.8.5", + "cross-env": "^7.0.3", "eslint-config-prettier": "^6.11.0", "eslint-plugin-prettier": "^3.1.3", "express": "^4.18.2", @@ -50,8 +51,8 @@ } }, "scripts": { - "start": "NODE_OPTIONS=--openssl-legacy-provider react-app-rewired start", - "build": "NODE_OPTIONS=--openssl-legacy-provider react-app-rewired build", + "start": "cross-env NODE_OPTIONS=--openssl-legacy-provider react-app-rewired start", + "build": "cross-env NODE_OPTIONS=--openssl-legacy-provider react-app-rewired build", "serve-build": "node scripts/serve-build.js", "lint": "eslint \"./src/**/*.js\"", "lint-fix": "eslint \"./src/**/*.js\" --fix",