Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling environment/configuration variables #128

Open
dac09 opened this issue Nov 5, 2020 · 3 comments
Open

Handling environment/configuration variables #128

dac09 opened this issue Nov 5, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request examples Resolve by adding examples good first issue Good for newcomers

Comments

@dac09
Copy link

dac09 commented Nov 5, 2020

Hi!

First, thank you so much for putting this together!

I had a question, regarding environment (or configuration) values. Do you have recommendations on how to configure the build with different configuration values e.g. api endpoint?

Right now I can see that we can use .env files inside renderer, but there's no obvious way of using environment variables in the main process (as macos doesn't load env variables when you launch outside the command line).

Perhaps something like this can be used when compiling the main code https://www.npmjs.com/package/babel-plugin-transform-inline-environment-variables?

Thanks in advance!

@dac09
Copy link
Author

dac09 commented Nov 5, 2020

As an aside, I think what would be really helpful is if we could customise the webpack configuration i.e. add our own plugins, and nextron can merge the configs.

@saltyshiomix saltyshiomix added enhancement New feature or request good first issue Good for newcomers labels Nov 29, 2020
@saltyshiomix saltyshiomix self-assigned this Nov 29, 2020
@saltyshiomix saltyshiomix added the examples Resolve by adding examples label Nov 29, 2020
@jt-l
Copy link

jt-l commented Jan 3, 2024

Any further insight on this? How to incorperate .env into nextron build? Do we have to use webpack (i.e., next.config.js)?

@jt-l
Copy link

jt-l commented Jan 3, 2024

Any further insight on this? How to incorperate .env into nextron build? Do we have to use webpack (i.e., next.config.js)?

I resolved the issue, nextJS will automatically pick up variables defined in .env.local in renderer, but they need to be prefixed with NEXT_PUBLIC in order to use them on the client side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request examples Resolve by adding examples good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants