Code Monkey home page Code Monkey logo

electron-node-config's People

Contributors

dw1284 avatar liamwhan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

electron-node-config's Issues

Does not work with electron cli

So I replaced my node-config with electron-node-config. If I run the express server normally, everything runs as expected. Now when I launch it via electron using the cli and not packaged. It throws errors. Makes developing hard if I have to build the app every time, rather than quick dev loading it.

Programatically set different env json

First, thanks for forking node-config and fixing the issue on Electron.

Just discovered a limitation with this tool, unable to set NODE_ENV when building thru electron-builder

$ NODE_ENV=staging build ....

This happened because we are not allowed to pass env variables on a packed electron app on start.

What I had to do to make it work is this:

  1. Add environment field in package.json

  2. Wrap electron-node-config in some JS file

     const pkg = require("../package");
     process.env.NODE_ENV = pkg.environment;
     module.exports = require('electron-node-config');
    
  3. Load the wrapper instead of directly using electron-node-config

It both works when we execute our app via CLI ($ electron .) or when we build different packed apps.

I did not yet submit a PR about our workaround because I think it may not be good practice to put environment in package.json. Let me know your thoughts.

Cheers!

Loading inside VS Code is counter-intuitive

C:\Users\elided\AppData\Roaming\npm\electron.cmd --nolazy --debug-brk=15312 main.js

WARNING: NODE_ENV value of 'dev' did not match any deployment config file names.
WARNING: See https://github.com/lorenwest/node-config/wiki/Strict-Mode
WARNING: No configurations found in configuration directory:C:\Users\elided\AppData\Roaming\npm\node_modules\electron\dist\resources\default_app.asar/config
WARNING: To disable this warning set SUPPRESS_NO_CONFIG_WARNING in the environment.

Why is it lunging down a path in C:/Users instead of just using the /config folder beneath the working folder when I debug?

(I'm also pursuing this as an issue in the way Electron and VS Code are set up. Seriously, 35 years of software development experience, and I've gone back to noob status because of Electron.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.