Skip to content

Releases: GoogleChromeLabs/worker-plugin

5.0.1

27 May 18:50
2225c95
Compare
Choose a tag to compare
  • Fixed crash on malformed new Worker() options object (#94, thanks @jebbench)

5.0.0

11 Aug 23:44
5021ef6
Compare
Choose a tag to compare
  • Webpack 5 compatibility (in addition to Webpack 4) (#84, thanks @gluck & @dkozma!)

  • New filename and chunkFilename options (#82):

    new WorkerPlugin({
        filename: '[name].[hash:5].js',
        chunkFilename: '[name].[hash:5].js',
    })
  • Reduce non-actionable warnings (#73)

  • Fix support for output filenames with querystring parameters (#74, thanks @brn!)

4.0.3

03 May 02:13
Compare
Choose a tag to compare
  • Fixed a bug parsing worker init options containing trailing commas (#66, thanks @alan-agius4)

Worker Plugin 4.0

10 Mar 22:21
Compare
Choose a tag to compare

Worker Plugin 4 brings a few nice new features:

πŸš“ Support for Webpack's strict ES Modules mode:

Using .mjs now works properly with worker-plugin, and actually produces better output than the default CommonJS internals (#61).

πŸ— A new worker-plugin/loader variant:

If you need to compile a module as a standalone set of bundles but don't need the new Worker parsing stuff, it's now possible to use this plugin's internal functionality as a loader! Just prefix your import with worker-plugin/loader! and you'll get back the bundle's URL. This is useful for bundling things like Worklets:

import workerUrl from 'worker-plugin/loader!./my-paint-worklet';
CSS.paintWorklet.addModule(workerUrl);

πŸŽ› Support for SharedWorker

Pass the {sharedWorker:true} option to enable automatic bundling of SharedWorker. (#42 - thanks @stutrek!).

Similarly, you can also now pass {worker:false} to disable automatic bundling of Worker. (#57 - thanks @gbmatt!)

🐞 Bugfix for trailing commas in worker init options

Previously, new Worker("./foo.js", { type:"module", }) would result in invalid JavaScript output. This has now been fixed. Unless configured to keep the type option around, the output is simply new Worker(bundleUrl). (#49 - thanks @arturovt!)

3.2.0

27 Aug 16:32
Compare
Choose a tag to compare

This release fixes two bugs relating to worker filename generation when no name is provided.

  • Fixes unnamed workers being duplicated when webpack is in watch mode
  • Fixes filename generation when using multiple unnamed workers (#35, thanks @alan-agius4!)

3.1.0

19 Feb 16:00
Compare
Choose a tag to compare
  • Fixes wasm support (#15, thanks @3846masa!)
  • New globalObject option (#20) - pass false to disable warnings.

3.0.0

14 Dec 15:47
Compare
Choose a tag to compare

Plugins are no longer inherited by default. This behaviour had been added in 2.0.0, but proved problematic in many configurations.

Instead, a new plugins option allows specifying which plugins to inherit, or custom plugins to add when bundling workers (#16 #17). Big thanks to @3846masa for making this work!

2.0.1

04 Dec 03:46
Compare
Choose a tag to compare

Note

It is strongly recommended to upgrade to 3.0.0. This 2.x version caused issues in many webpack configurations.

  • Correct peerDependencies to require Webpack 4+ (#1)
  • Run any plugins defined in the parent in the Worker compiler as well (#13, thanks @lacolaco!)

πŸ› If you encounter any issues upgrading to this version, please file a bug.

1.1.1

12 Oct 02:49
Compare
Choose a tag to compare
  • Fix error when output.chunkFilename contains [chunkhash] or [contenthash].
  • Fixes a case where some unreported child compiler errors would be hidden.

1.1.0

09 Oct 17:01
Compare
Choose a tag to compare
  • Fixes an issue when Webpack is configured to transpile node_modules (#4, thanks @TimvdLippe)
  • The compiled output no longer includes { type: 'module' }, since it can raise a SyntaxError.

Upgrade notes: This should just fix a browser support issue in 1.0.0, so it's not a breaking change.
Though it is not recommended, if you're relying on outputting actual module Workers there is a new option to retain { type: 'module' } in the compiled code:

new WorkerPlugin({ preserveTypeModule: true })