This plugin allow you to use environment variables inside your code by importing process.env as a faux module. The environment variable will be baked into your bundle at compile time. It leverages rollup tree shakable modules to only include variables being used. Compilation fails if there are imports to unset variables.
import { NODE_ENV, FOO, BAR } from 'process.env';
console.log(FOO, BAR);
if (NODE_ENV === 'production') {
// code
}
Awesome Contribution Checklist:
Please Provide a Link A Repository for Your Addition
https://github.com/victornpb/rollup-plugin-baked-env
Please Describe Your Addition
This plugin allow you to use environment variables inside your code by importing process.env as a faux module. The environment variable will be baked into your bundle at compile time. It leverages rollup tree shakable modules to only include variables being used. Compilation fails if there are imports to unset variables.