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

Allow dependencies to use environment variables in middlewares #33141

Merged
merged 4 commits into from
Jan 10, 2022

Commits on Jan 10, 2022

  1. Allow dependencies to use environment variables in middlewares

    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 vercel#33043.
    Schniz committed Jan 10, 2022
    Configuration menu
    Copy the full SHA
    6234605 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9988e92 View commit details
    Browse the repository at this point in the history
  3. Update packages/next/build/polyfills/process.js

    Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
    Schniz and sokra authored Jan 10, 2022
    Configuration menu
    Copy the full SHA
    f2cc463 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d54db0c View commit details
    Browse the repository at this point in the history