I am trying to add JS functionality to a project that needs env variables to work properly. Basic project structure is as
- assets/ (cs / js)
- src/ (php stuff)
.env
webpack.config.js
When I add process.env.key to js files in assets I get error 'process' is not defined running yarn build/dev/watch.
I have tried following suggestions found:
But all result in 'process not defined' on compile.
What might I be missing here? How do I debug the yarn build process?