Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): tags disappear if CDK app is bundled+minified #26181

Merged
merged 4 commits into from
Jul 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/aws-cdk-lib/core/lib/tag-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { CfnTag } from './cfn-tag';
import { Lazy } from './lazy';
import { IResolvable } from './resolvable';

const TAG_MANAGER_SYM = Symbol.for('@aws-cdk/core.TagManager');

interface Tag {
key: string;
value: string;
Expand Down Expand Up @@ -301,7 +303,7 @@ export class TagManager {
*/
public static isTaggable(construct: any): construct is ITaggable {
const tags = (construct as any).tags;
return tags && typeof tags === 'object' && tags.constructor.name === 'TagManager';
return tags && typeof tags === 'object' && (tags as any)[TAG_MANAGER_SYM];
}

/**
Expand Down Expand Up @@ -461,3 +463,4 @@ export class TagManager {
}
}
}
(TagManager.prototype as any)[TAG_MANAGER_SYM] = true;