emitIdentity
이 페이지에서

emitIdentity()

함수, 도구 분류

A stable, human-readable identity for one emit configuration.

import { emitIdentity } from 'typeshade'

시그니처, 설명, 예제는 커밋 c66579bf의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.

구문

function emitIdentity(target: EmitTarget, opts?: EmitIdentityInput, m?: ModuleDecl): string

매개변수

target EmitTarget

the backend that emitted the artifact.

opts선택 사항 EmitIdentityInput

the same options object handed to the emit call.

m선택 사항 ModuleDecl

the module that was emitted. Optional, and only meaningful when the identity describes one module’s emit. The emulateCompute marker records that the compute-to-fragment rewrite ran, and on GLSL a portable-declared compute entry runs it with no emit option, so without the module a portable module’s GLSL stamp would describe a plain emit. A stamp that covers many modules (a registry banner) omits this argument and keeps its option-only meaning.

반환값

string

a one-line identity: a readable summary, then # and a 32-bit digest of it.

설명

emitIdentity('glsl-es300') // 'glsl-es300;parens=full;fp64=float;plugins=-#…'
emitIdentity('glsl-es300', { plugins: obfuscate() })
// '…;plugins=mangle+prune-prototypes+alias-types+minify#…'

Write it beside a committed artifact (a registry banner, a manifest line, a file name) and compare it after a build. Equal stamps mean the same emit configuration produced both. Different stamps name which axis moved, because the readable half is not hashed away.

The identity covers the target, parens, fp64Flavor, emulateCompute, whether override values were pinned (and to what), and the plugin chain in order.

It does not cover a plugin’s own options: minify({ …a }) and minify({ …b }) are both minify here. A plugin that needs finer granularity sets EmitPlugin.identity, which is used in place of its name.

관련 가이드

함께 보기

소스

src/core/emit-identity.ts, 83행, 커밋 c66579bf 기준

이 페이지 편집 문제 보고