Skip to content

Instantly share code, notes, and snippets.

@karfau
Last active December 8, 2019 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karfau/b6d0927628f6662ca6d892153562522f to your computer and use it in GitHub Desktop.
Save karfau/b6d0927628f6662ca6d892153562522f to your computer and use it in GitHub Desktop.
workaround for typeorm no longer loading ormconfig.env by default
// Source: https://gist.github.com/karfau/b6d0927628f6662ca6d892153562522f
// 1. copy this file to your root directory alongside ormconfig.env
// in your package.json scripts/mocha.opts, etc add
// --reqister ./ormconfig.register.js
// or
// -r ./ormconfig.register.js
const {config} = require('dotenv');
const path = require('path');
config({path: path.join(__dirname, 'ormconfig.env')});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment