Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

Fixes error to extract constructor name using build --prod #1413

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

leandrogehlen
Copy link

Short description of what this resolves:

Fixes error to extract constructor name using build --prod

Fixes:
When we needs extract constructor name from class, (like migrations), usinb build --prod the
uglify process can't do it.

Example

class  m201707121646_create_post {
  up(): Array<string> {
       return [
         `ALTER TABLE "post" ALTER COLUMN "title" RENAME TO "name"`,
         `ALTER TABLE "post" ADD COLUMN "category_id" INTEGER`
       ];
   }
}

const MIGRATIONS: Array<any> = [
 m201707121646_criar_pessoa
];

MIGRATIONS.forEach((migration) => {
     const instance = new migration();
     console.log((<any>instance).constructor.name);    
}
 

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant