nartc / mapper

🔥 An Object-Object AutoMapper for TypeScript 🔥
https://automapperts.netlify.app/
MIT License
980 stars 87 forks source link

Transformer Plugin in swc #602

Closed thk-powertask closed 6 months ago

thk-powertask commented 6 months ago

Is there an existing issue for this?

Describe the issue

I am using nestjs in my personal project and I am using swc compiler. Transformer Plugin I'm trying to use , but the function of __AUTOMAPPER_METADATA_FACTORY__ is not created during the build process. Can you tell me why?

Models/DTOs/VMs

No response

Mapping configuration

{
  "$schema": "https://json.schemastore.org/nest-cli",
  "collection": "@nestjs/schematics",
  "sourceRoot": "src",
  "compilerOptions": {
    "deleteOutDir": true,
    "builder": "swc",
    "typeCheck": true,
    "plugins": [
      {
        "name": "@automapper/classes/transformer-plugin",
        "options": {
          "modelFileNameSuffix": [
            ".info.ts",
            ".dto.ts",
            ".entity.ts"
          ]
        }
      }
    ]
  }
}

Steps to reproduce

No response

Expected behavior

in dist folder

class UserMain {
    static __AUTOMAPPER_METADATA_FACTORY__() {
        return [
            ["email", { type: () => String, depth: 1 }],
            ["createdDt", { type: () => String, depth: 1 }]
        ];
    }
}

Screenshots

No response

Minimum reproduction code

No response

Package

Other package and its version

No response

AutoMapper version

8.0.0

Additional context

No response

alejandro-pena1 commented 2 months ago

@thk-powertask did you find any solution?