GoogleChromeLabs / worker-plugin

👩‍🏭 Adds native Web Worker bundling support to Webpack.
https://npm.im/worker-plugin
Apache License 2.0
1.91k stars 79 forks source link

Trailing comma when options parameter contains only `type: module` #65

Closed alan-agius4 closed 4 years ago

alan-agius4 commented 4 years ago

When the Worker call expression 2 parameter contains only an object literal with type: 'module' it will produce a trailing comma in the output which will result in a syntax error in some browsers such as IE11.

Input:

const hashcashWorker = new Worker('./hashcash.worker', {
  type: 'module'
});

Output

const hashcashWorker = new Worker(__webpack__worker__0, );

Version: 4.0.2 Related to: https://github.com/angular/angular-cli/issues/17373