Skip to content

set-node-process-env by linux bash command without need git ignore the .env file

License

Notifications You must be signed in to change notification settings

xgqfrms/set-node-process-env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

set-node-process-env

set-node-process-env by linux bash command without need git ignore the .env file

https://www.npmjs.com/package/set-node-process-env

install

$ yarn global add set-node-process-env
# OR
$ npm i -g set-node-process-env

usage

# PORT_ENV for webpack
$ snpe PORT_ENV=8090

demo

// webpack.config.js
const PORT_ENV = process.env.PORT_ENV || 8080;

console.log('PORT_ENV =', PORT_ENV);

// const ip = require('ip');
// const hostIp = ip.address();
const config = {
  // ...
  devServer: {
    // ...
    // host: hostIp,
    port: PORT_ENV,
    proxy: [
      {
        context: ['/web/api/'],
        // dev
        target: 'https://web-dev.xgqfrms.xyz',
        // prod
        // target: 'https://web-prod.xgqfrms.xyz',
      },
    ],
  },
};

module.exports = config;

refs

https://www.npmjs.com/package/app-node-env

About

set-node-process-env by linux bash command without need git ignore the .env file

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published