pulseshift / openui5-gulp-starter-kit

A progressive enterprise-ready project template with Gulp and OpenUI5
MIT License
51 stars 12 forks source link

Cross Platform Environment Variables #18

Closed sonerokur closed 6 years ago

sonerokur commented 6 years ago

Yarn scripts in package.json does not work as expected in Windows environment.

"start": "NODE_ENV=development DEV_PORT=3000 babel-node node_modules/gulp/bin/gulp.js --silent",
"start:verbose": "NODE_ENV=development DEV_PORT=3000 babel-node node_modules/gulp/bin/gulp.js",
"start:dist": "NODE_ENV=production DEV_PORT=3000 babel-node node_modules/gulp/bin/gulp.js testDist",
"build": "NODE_ENV=production babel-node node_modules/gulp/bin/gulp.js build --silent",
"build:verbose": "NODE_ENV=production babel-node node_modules/gulp/bin/gulp.js build",

I suggest we can change these scripts for cross-platform support like below.

"start": "env-cmd dev babel-node node_modules/gulp/bin/gulp.js --silent",
"start:verbose": "env-cmd dev babel-node node_modules/gulp/bin/gulp.js",
"start:dist": "env-cmd prod babel-node node_modules/gulp/bin/gulp.js testDist",
"build": "env-cmd prod babel-node node_modules/gulp/bin/gulp.js build --silent",
"build:verbose": "env-cmd prod babel-node node_modules/gulp/bin/gulp.js build",

To use "env-cmd", first we need to run "npm install env-cmd --save-dev" and then create .env_cmdrc file with below lines

{
  "dev": {
    "NODE_ENV": "development",
    "DEV_PORT": 3000
  },
  "prod": {
    "NODE_ENV": "production",
    "DEV_PORT": 3000
  }
}
fuchsvomwalde commented 6 years ago

Hi @sonerokur,

Thanks to you so much for testing, we have also seen the pull request. :-) I'll watch it tonight or at the weekend at the latest and try to integrate your solution asap.

Many greetings

fuchsvomwalde commented 6 years ago

Merged pull-request as an interim solution and created a new issue for a future milestone: https://github.com/pulseshift/openui5-gulp-starter-kit/issues/20