-
Hi 👋 ! I was wondering if someone had setup a "hello world" project that uses catalyst and webpack? After reading the blog post I was trying to follow the guide to create a "Hello world" component. It works if I set // ... lots of code for the clipboard element
let w = class extends HTMLElement {
connectedCallback() {
this.innerHTML = 'Hello World!',
console.log('hellllooooooooo 👋')
}
};
w = function (t, e, o, n) {
// ... mode code here Not sure why but it seems like the name of the variable that the class is assigned to The code is in https://github.com/betatim/try-catalyst, the output in
As you can tell from the last command, I use Python a lot and super new to JS/typescript and all that. Maybe there is some basic misconfiguration in my webpack or TS config? I'm not particularly attached to using webpack, I picked it because I've used it before. It seems weird that it works in development mode but not production :-/ What I would like to be able to do is use catalyst, create my own components, build a Any and all pointers would be welcome! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Webpack is mangling the class name during minification. Since catalyst will get the class name at runtime and register a custom element from that name, you need to make sure that class names aren't changed during modification. I'm not sure how this is done in webpack. The minified that I'm most familiar with: |
Beta Was this translation helpful? Give feedback.
Webpack is mangling the class name during minification. Since catalyst will get the class name at runtime and register a custom element from that name, you need to make sure that class names aren't changed during modification.
I'm not sure how this is done in webpack. The minified that I'm most familiar with:
terser
has an option to keep class names unmangled.