Treverix / custom-electron-titlebar

Custom electon title bar inpire on VS Code title bar
MIT License
35 stars 6 forks source link

build error with webpack 4 #2

Closed Znerole closed 4 years ago

Znerole commented 4 years ago

Using version 4.1.2 in a webpack 4 build triggers an error:

Module parse failed: Unexpected token (76:17)
File was processed with these loaders:
 * ./node_modules/source-map-loader/dist/cjs.js
You may need an additional loader to handle the result of these loaders.
|     };
| 
>     if (!options?.iconsTheme) {
|       if (platform_1.isWindows || platform_1.isLinux) {
|         this._options.iconsTheme = themebar_1.Themebar.win;

The reason is that this project targets "ES2020" and the typescript compiler emits code with optional chaining which webpack 4 cannot process directly (see https://github.com/webpack/webpack/issues/10227).

I propose to revert the target back to "ES2019" (like it was in <4.1.x versions). I tried this locally and didn't encounter any problems.

Thanks for keeping this project alive in the electron 10+ era!

Treverix commented 4 years ago

Thanks for reporting that. I don't use webpack so I didn't see that and, of course, switch back to ES2019.

Treverix commented 4 years ago

https://github.com/Treverix/custom-electron-titlebar/releases/tag/4.1.3