Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.

Webpack's removes classnames when minifying/uglifying ES6 code with inheritance #394

Closed
ericmorand opened this issue Feb 13, 2019 · 2 comments

Comments

@ericmorand
Copy link

This is a follow-up to #269.

This is still not fixed. Using this perfectly valid ES6 syntax:

class Foo {
    getConstructorName() {
        return this.constructor.name;
    }
}

let foo = new Foo();

console.warn(foo.getConstructorName()); // output "Foo" when non-minified; "" when minified

webpack will output "" instead of "Foo".

I insist on the fact that this is a perfectly valid syntax that totally respects ES6 specifications. There is not point arguing about that.

@alexander-akait
Copy link
Member

Because uglify-js doesn't support es6 syntax, please use terser plugin

@alexander-akait
Copy link
Member

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants