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

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