Releases: jouni-kantola/templated-assets-webpack-plugin
v4.0.0
Rspack compatibility
To support Rspack without installing webpack too, dependencies to webpack internals are now more loosely coupled.
Breaking changes
Only webpack v5+ is supported now. For webpack v2-4 use templated-assets-webpack-plugin@v3
.
Full Changelog: v3.0.2...v4.0.0
Update dependencies
Dependencies updated: v3.0.1...v3.0.2
- Followed Dependabot's suggestions
- Removed redundant dependencies from
package.json
Update dependencies
- Updated
webpack-sources
- Dev dependencies updated (with aim to keep compatibility with Node v10.13)
- Updated according to dependabot's auto-updateable suggestions
Improved handling of paths to webpack's assets
Sometimes, releasing comes down to the question: Does this fix require a patch or major release version bump? We chose the route of releasing a new major version, as the fix change default behavior.
Breaking change
If webpack's publicPath
property isn't configured, assets are now referenced without any fixed path. This amends the incorrect behavior of generating paths from root (/
), which basically required configuring webpack's publicPath
.
Generated path examples
v2.0.0
: No publicPath
set: src="/app.2040305dd5041a6ac9e8.min.js"
(buggy behavior)
v3.0.0
: No publicPath
set: src="app.2040305dd5041a6ac9e8.min.js"
(fixed)
v2.0.0
: publicPath
set to dist
: src="dist/app.2040305dd5041a6ac9e8.min.js"
v3.0.0
: publicPath
set to dist
: src="dist/app.2040305dd5041a6ac9e8.min.js"
Bug fixes
- webpack@5 sets
publicPath
toauto
if not explicitly set.auto
is now stripped from path in a templated asset. - If separate output location configured for templated assets, now fixed so
[contenthash]
can be used with webpack@5. - webpack@2 included as supported peer dependency.
- Configuration changed for unit tests, which enables test runs in Windows.
v3.0.0-beta.1
Fixed #128
v3.0.0-beta.0
v3 beta
webpack 5 support
webpack 5 support
webpack 5 support added. Backwards compatible to previous versions of webpack.
No changes in plugin's supported configuration.
Breaking changes
Node.js v10.13.0
is a minimum now. This follows webpack's Node.js requirement for webpack 5.
Default rules
Default to creating templated assets for all JavaScript and CSS files, when no rules are specified.
So now, to get started using templated-assets-webpack-plugin
, this is OK:
const TemplatedAssetsWebpackPlugin = require("templated-assets-webpack-plugin");
...
plugins: [new TemplatedAssetsWebpackPlugin()]
Asset type module/nomodule
Built-in templates included for referencing assets as module
or nomodule
. Specified in rules' output
.
Tap into emit hook
When plugin is used with a webpack version that supports the hooks API, the plugin now taps to the emit
hook. Fallback stays as previous version of templated-assets-webpack-plugin
, to act on webpack's emit event.