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

Instruct terser to not mangle class names so Catalyst works #1314

Merged
merged 1 commit into from
Aug 16, 2022

Conversation

camertron
Copy link
Contributor

@langermank and I have been running into weird issues viewing Lookbook previews where JavaScript for Catalyst components is throwing uncaught errors. The problem turns out to be that terser mangles class names to make them shorter. Catalyst depends on class names to automatically define custom elements. In their docs, the terser section says to pass a special option that disables class name mangling. Adding this to my local rollup config fixes the problem.

@changeset-bot
Copy link

changeset-bot bot commented Aug 16, 2022

🦋 Changeset detected

Latest commit: b461fb1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/view-components Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@camertron camertron temporarily deployed to github-pages August 16, 2022 22:05 Inactive
@camertron camertron marked this pull request as ready for review August 16, 2022 22:12
@camertron camertron requested review from a team and jonrohan August 16, 2022 22:12
@camertron camertron merged commit 9aef2dc into main Aug 16, 2022
@camertron camertron deleted the keep_js_class_names branch August 16, 2022 22:58
@primer-css primer-css mentioned this pull request Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants