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

How to load .env.test with razzle start #1888

Open
derweili opened this issue Jul 29, 2022 · 0 comments
Open

How to load .env.test with razzle start #1888

derweili opened this issue Jul 29, 2022 · 0 comments

Comments

@derweili
Copy link

❓Question

I would like to run Cypress with razzle js. Therefore I followed the instructions from here #1700

My problem is, I would like to use test-specific environment variables. So I added a new .env.test file and tried to load it.
Unfortunatelly, this file will never load outside of the razzle test unit tests.

I tried following script from the mentioned instructions in package.json:

"scripts": {
  "start:test": "NODE_CONFIG_ENV=test razzle start",
},

I also added NODE_ENV

"scripts": {
  "start:test": "NODE_CONFIG_ENV=test NODE_ENV=test razzle start",
},

But the .env.test file never gets loaded.
How can I load this .env.test file when starting or building my razzle app?

@derweili derweili changed the title How to load .env.test outside of razzle test How to load .env.test outside of razzle test Jul 29, 2022
@derweili derweili changed the title How to load .env.test outside of razzle test How to load .env.test with razzle start Jul 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant