choojs / create-choo-electron

:electron: - Create a fresh Choo Electron application
MIT License
29 stars 11 forks source link

NODE_ENV doesn't work on windows #1

Open yoshuawuyts opened 7 years ago

yoshuawuyts commented 7 years ago

See https://github.com/choojs/create-choo-app/issues/20

λ npm start

> choo-electon-app-01@1.0.0 start D:\gitwork\choo-electon-app-01
> NODE_ENV=development electron main.js

'NODE_ENV' is not recognized as an internal or external command,
operable program or batch file.
conoro commented 7 years ago

This works on Windows:

"start": "set NODE_ENV=development && electron main.js"
chrisdwheatley commented 6 years ago

Took a quick look at this & the related issue in create-choo-app, I think you might be able to get away with not using cross-env (for now at least) by removing the setting of NODE_ENV and allowing users to set it themselves when desired.

e.g. UNIX users run NODE_ENV=production && npm start, Windows users run set NODE_ENV=production & npm start and so on and so forth for other platforms.

There may be some intricacies I'm missing so feel free to correct me if that's the case.

yoshuawuyts commented 6 years ago

@chrisdwheatley from my own experience I tend to forget setting NODE_ENV=production all too often, haha — something we might do is set the knob to production in bankai build by default, so we can evade this.

A PR would be very welcome to set that behavior by default in Bankai, and then another to remove cross-env from all our create-choo-* repos! — hope this make sense; thanks! :sparkles: