Releases: GoogleChromeLabs/worker-plugin
5.0.1
5.0.0
-
Webpack 5 compatibility (in addition to Webpack 4) (#84, thanks @gluck & @dkozma!)
-
New
filename
andchunkFilename
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
Worker Plugin 4.0
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
3.1.0
3.0.0
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
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
1.1.0
- 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 })