tsdx icon indicating copy to clipboard operation
tsdx copied to clipboard

Support for .env files

Open jonit-dev opened this issue 1 year ago • 1 comments

Current Behavior

It seems that tsdx doesn't have support for loading .env files. Even when adding a custom tsdx.config.js with this plugin, it loads variables as undefined.

Desired Behavior

Load .env files properly.

jonit-dev avatar Oct 02 '22 07:10 jonit-dev

@jonit-dev It worked for me that way

const dotenv = require('rollup-plugin-dotenv');

module.exports = {
  rollup(config, options) {
    config.plugins.unshift(dotenv.default());

    return config;
  },
};

eliezer-souza avatar Nov 02 '22 17:11 eliezer-souza