vue-cli-plugin-electron-builder
vue-cli-plugin-electron-builder copied to clipboard
Use --mode argument to be consistent with Vue CLI
Vue CLI uses --mode
argument to set NODE_ENV
however we do the opposite here.
It would be nice to be part of Vue convention, this way users can except similar behavior to npm run electron:build
just like npm run build
and set the environment in a unified consistent way.
It would also simplify understanding of how vue-cli-service build
is called internally.
Unidentical APIs also cause a bug/limitation like #1627
I'm not sure what you mean by "we do the opposite here," can you elaborate a bit more?
I'm sorry for my bad formulation.
Vue CLI uses --mode
to set NODE_ENV
for e.g. webpack.
vue-cli-plugin-electron-builder
uses NODE_ENV
to set --mode
.
A code snippet example I found is here.
So as a workaround, I set both:
mode='production'
npm install --global cross-env
cross-env-shell NODE_ENV="$mode"
npm run electron:build -- --publish never --mode "$mode"
But it would be nice to be able to skip setting NODE_ENV
environment variable and rely on --mode
only.