circlecell / jscompress.com

Site to minify/compress javascript and combine multiple files into a single compressed file
http://jscompress.com
ISC License
305 stars 101 forks source link

Support for the experimental syntax 'classPrivateProperties' isn't currently enabled #84

Open farsighted6 opened 2 years ago

farsighted6 commented 2 years ago

I enabled checkbox "ECMAScript 2022 (via babel-minify)" and get following error :

SyntaxError: unknown: Support for the experimental syntax 'classPrivateProperties' isn't currently enabled (2:3):

1 | class ClassWithPrivateField {

2 | #privateField; | ^ 3 | } 4 | 5 |

Add @babel/plugin-proposal-class-properties (https://git.io/vb4SL) to the 'plugins' section of your Babel config to enable transformation. If you want to leave it as-is, add @babel/plugin-syntax-class-properties (https://git.io/vb4yQ) to the 'plugins' section to enable parsing.

More info on "#privateField" : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Private_class_fields

gheescoo commented 6 months ago

Same. I have got used to C-style classes