Can't connect to right identity: `.env` file is ignored

I have in loginOptions:

    identityProvider:
      process.env.DFX_NETWORK === "ic"
        ? `https://nfid.one`
        : `http://localhost:8000/?canisterId=${process.env.CANISTER_ID_INTERNET_IDENTITY}`,

Nevertheless, when I connect to my real ic canister, Login button tries to connect to http://localhost:8000. Why and how to make it connect to nfid.one?

$ cat .env
...
DFX_NETWORK='ic'
...

F5 and Ctrl+F5 in browser don’t help.

I have

    new webpack.EnvironmentPlugin([
      ...Object.keys(process.env).filter((key) => {
        if (key.includes("CANISTER")) return true;
        if (key.includes("DFX")) return true;
        if (key.includes("REACT_APP")) return true;
        return false;
      }),
    ]),

in webpack.config.js, so DFX_NETWORK should work, but it doesn’t :-~

Nevermind, I’ve found the error.