Open just-boris opened 2 months ago
When a constant value imported from a different module, it is not inlined properly. Reproducible in the online playground.
import { isDevelopment } from "./is-development"; export function devWarning() { if(isDevelopment) { console.log('test') } } export function run() { devWarning('dev only'); }
is-development.js contents
export const isDevelopment = false; // does not work either // export const isDevelopment = process.env.NODE_ENV !== "production";
The output still contains an unused function: function o(){!1}. Expected to eliminate all this code, as it happens in a single file setup
function o(){!1}
When a constant value imported from a different module, it is not inlined properly. Reproducible in the online playground.
is-development.js contents
The output still contains an unused function:
function o(){!1}
. Expected to eliminate all this code, as it happens in a single file setup