0

I want to be able to use environment variables in an .env file inside a package.json script.

.env file:

MY_URL="example.com"

MY_BROWSER='chrome'

USER='xyz'

PASSWORD='123'

So instead of :

"myscript": "pnpx playwright codegen https://myurl.com",

I want something like:

"myscript": "pnpx playwright codegen $MY_URL,

I've tried using env-cmd but not getting result I want as the browser opens with no url

Ger Mc
  • 630
  • 3
  • 11
  • 22

0 Answers0