--- title: Let's talk about my import.meta.env.SITE --- export const modeWorks = import.meta.env.MODE === 'production' ? 'MODE works' : 'MODE does not work!'; # About my import.meta.env.SITE My `import.meta.env.SITE` is so cool, I can put env variables in code! ```js const site = import.meta.env.SITE; ``` ## But I can use import.meta.env properly too
I can compute my site, for example: {new URL('/blog/cool-post', import.meta.env.SITE)}
I can also use `import.meta.env` in variable exports: {modeWorks}
I can also use vars as HTML attributes: