v0.3 - The Christmas Release
🎄 Santa Clause is coooooming to town... with a jolly song on his lips and bag full of features and improvements over his shoulder! 🎄
A version bump to 0.3
might not sound very spectacular, but this release is! Consider it one step before the 1.0 release candidate.
Update to v0.3
Since there has been a breaking change affecting all blocks, make sure that you upgrade all blocks to ^0.3.0
together. An update note has been added to the README as well.
So what has been done?
Context object
There is one major breaking change under the hood:
fileTypes
is not passed to blocks as first parameter anymore, but rather a context
object containing a fileType
property (which does the same).
The real gimmick here is that you can modify this context object to save metadata you need somewhere else, but that is not supposed to be put into the webpack config object. Very useful in combination with hooks (see below).
Webpack 2
The webpack 2 blocks have been merged into the master branch and logic that is common to webpack 1.x and 2.x blocks has been moved to a new @webpack-blocks/webpack-common
package.
Also the webpack2
block is now using the webpack 2 release candidate version and supports webpack performance budgets (use performance()
).
Hooks
Another great feature to achieve things that could not be done with webpack-blocks
before. For instance you can now use defineConstants()
to instantiate a webpack.DefinePlugin
instance. So far so good, but you can use defineConstants()
multiple times and end up having one single webpack.DefinePlugin
instance containing the constants of all defineConstants()
calls.
Check out How to create your own blocks for details.
Presets
There a new sharp tool in the shed: group()
. It lets you combine a set of blocks to a new block that provides the functionality of all those single blocks. Now that there are hooks allowing for more intelligent merging you can now write powerful presets if you get bored during the holidays!
How to create one? Read the manual 😉
Babel6
The babel6
block now supports include
(additionally to exclude
), presets
and plugins
options. So you can now configure babel from within your webpack configuration using webpack-blocks.
Credits
Special thanks again goes to @eXon for steady contribution and feedback! 🙂
Merry Christmas!