next.js
4aa9879d - Allow dependencies to use environment variables in middlewares (#33141)

Commit
4 years ago
Allow dependencies to use environment variables in middlewares (#33141) After discussing with @sokra, seems that the proposed solution is split in two: * We need to make sure that the `process` polyfill uses `global.process` if available. This is because middlewares are bundled using `browser` target and therefore `process.env.MY_ENV` gets shimmed into `require('process').env.MY_ENV`. * Allow `process.env` to be statically analyzed for dependencies so they will be exported to the manifest. Related issues: * should fix #33043.
Author
Parents
Loading