Closed Cr4zyc4k3 closed 7 months ago
What is the recommended way to detect the local development environment?
I tested wrapping the following blocks with if (BRANCH !== 'dummy') { ... }
, so Webpack can drop the code. But probably there is some better check.
What is the recommended way to detect the local development environment?
I tested wrapping the following blocks with
if (BRANCH !== 'dummy') { ... }
, so Webpack can drop the code. But probably there is some better check.* Branches: https://github.com/buffcode/LSSM-V.4/blob/271e5e520e31d93883595ce983862d7779d41b94/src/components/settings.vue#L850-L856 * Release notes: https://github.com/buffcode/LSSM-V.4/blob/eb48d37b27fcf6e215bd51956e01c9ad7c6538c0/src/mainpageCore.ts#L135-L138
I would not rely on a check if we're running on a local server as we already did in src/config.ts
.
It exports a const PORT_ENV_KEY
which could be used: const isLocalServer = typeof process !== 'undefined' && PORT_ENV_KEY in process.env;
Probably, one would have to do that within /build/index.ts
and define a global constant within DefinePlugin
to handle it correctly und to allow dropping the code accordingly. In combination with correct type in src/global.d.ts
that could work.
Couldn't we reuse MODE
? It currently maps development
(which is the default when no mode is specified) to beta
.
Either we could refine this and passtrough production | beta | development
, or just check for beta
at those places as this is also the default for the dev
branch.
Distinguishing between beta
and development
is definitely mandatory in my eyes as we would otherwise supress the error messages at the live beta build.
Done in #2865 . File download will be done in the prebuild phase.
is it possible to delete these messages locally?
Originally posted by @deoxis9001 in https://github.com/LSS-Manager/LSSM-V.4/issues/2865#issuecomment-1925746524