Using combine with unplugin-original-class-name

If you enabled minify or similar options in your build tool config, you cannot get the name of a class in compiled code.

For example, you may get compiled code like this:

class A(e,t){this.name=e,this.age=t,this.isGreeting=!1}

In this case, the original class name Person is lost.

To solve this problem, we can use the unplugin-original-class-name plugin. This plugin will add a static property className to each class.

Installation

Refer to unplugin-original-class-name documentation for installation instructions.

Configuration

Use configureSerializer function before using serializable decorator to set the getOriginalNameOf function.

import { getOriginalNameOf } from "virtual:original-class-name";
import { configureSerializer } from "@graphif/serializer";

configureSerializer(getOriginalNameOf);