title | permalink | nav_order |
---|---|---|
Changelog |
/changelog |
10 |
- Breaking: End support for Node v10. Node v12.13 or later is now required.
- Breaking: Switch to Webpack 5 and Webpack DevServer 4
- Breaking: Include a contenthash string in default bundle file names. Set
filename: '[name].js'
in your output configuration to restore the old behavior. - Breaking: Default DevServer manifest name is now
development-asset-manifest.json
, notasset-manifest.json
. - Breaking: Replace
filterLoaders
system with individual hooks accesible via the newaddFilter
andremoveFilter
helpers. - Breaking: Remove deprecated
eslint-loader
and addeslint-webpack-plugin
to presets asplugins.eslint()
. - Potentially Breaking: Remove
loaders.url()
andloaders.file()
in favor of Webpack 5asset
modules, now usable by includingloaders.asset()
(for assets which can be inlined) andloaders.resource()
(as a catch-all for other types) in your module rules list. Asset modules are handled automatically in both presets, so this is only breaking ifloaders.url()
orloaders.file()
was used directly. - A
webpack-manifest-plugin
instance is now automatically injected in development mode even ifpublicPath
is not specified. - A
webpack-bundle-analyzer
plugin is now automatically added to production builds when Webpack is invoked with the--analyze
flag. - Add the
simple-build-report-webpack-plugin
asplugins.simpleBuildReport()
- Include a
plugins.simpleBuildReport()
instance in production preset builds to improve legibility of Webpack console output. plugins.fixStyleOnlyEntries()
now useswebpack-remove-empty-scripts
instead ofwebpack-fix-style-only-entries
due to Webpack 5 compatiblity issues with the original plugin.- Allow
null
to be returned from anaddFilter
callback to skip a loader when using a configuration preset. - Do not deep merge options passed to
plugins.terserPlugin()
: options object can now fully overwriteterserOptions
property if needed. - Permit filtering the Terser default configuration using
addFilter( 'plugins/terser/defaults', cb )
. - Remove
OptimizeCssAssetsPlugin
(plugins.optimizeCssAssets()
) in favor of Webpack 5-compatible CssMinimizerPlugin (plugins.cssMinimizer()
) - Remove
plugins.hotModuleReplacement()
, which is now handled automatically by the DevServer inhot
mode. - Include the
contenthash
in generated CSS filenames. #204
- Do not compress output or strip comments in the SASS loader. This fixes an issue where autoprefixer directive comments would be removed by
sass-loader
, potentially causing compilation errors. #180
- Correctly output
.rtl.css
manifest entries when using theWebpackRTLPlugin
. #171 - Breaking: Require Webpack CLI version 3 to avoid DevServer issues. If your project uses v4, run
npm install webpack-cli@3
to downgrade. #168 - Potentially Breaking: Extend auto-shared seeds for manifest generation to
development
preset. The upshot of this is that multi-config setups in development don't need custom manifest configurations to use the same manifest--they'll do so automatically. #166 - Internal: Pin
run-parallel
subdependency (required bycopy-webpack-plugin
) to 1.1.9 to guarantee Node v10 compatibility. #167
- Correctly infer a default publicPath when using
withDynamicPort
helper. #161
- Update WordPress
externals
object to match latest bundled scripts. #160
New Features
- Adapt the value of
output.path
when inferringoutput.publicPath
in DevServer so that all assets are correctly served in multi-config situations. #156 - Generate a
production-asset-manifest.json
for all production preset builds. #153 Builds in a multi-configuration setup which target the same output folder will share a manifest. #154
Upgrades & Changes
- Potentially Breaking: Update
mini-css-extract-plugin
to v1.3.4. Changelog. #148 - Potentially Breaking: Update
css-loader
to v5.0.1. Changelog. #136 - Potentially Breaking: Update
style-loader
to v2.0.0. Changelog. #127
All three of the above dependency upgrades include breaking API changes. None of these changes should impact vanilla usage of the presets provided by these helpers, but we recommend reviewing all three libraries' changelogs to identify potential issues if you are customizing presets or loader behavior relating to stylesheets.
The manifest plugin now exports its constructor as a named export, not a default, so any custom builds which pull in the ManifestPlugin
constructor directly from the plugin dependency (as opposed to using the recommended plugins.manifest()
factory function) will need to switch to using plugins.constructors.ManifestPlugin
. This should not impact un-customized presets.
- Potentially Breaking: Update
postcss-flexbugs-fixes
to v5.0.2 and updatepostcss-loader
to v4.1.0. #152
The upgrade to postcss-loader
requires nesting PostCSS configuration options within a .postcssOptions
key on the object passed to the webpack loader. As with the style loading changes above, if you use the presets without customization this should not impact your project. Otherwise, ensure you have added this level of nesting to any code which customizes the postcss-loader
's configuration object. Consult the postcss-loader
changelog for more information.
-
Upgrade
webpack-fix-style-only-entries
plugin to v0.6.0. This may resolve the issue previously documented in #93 where files would be incorrectly deleted when processing an array of webpack configuration objects. #129 -
Include
postcss
as a direct dependency of this package, rather than a subdependency. #151 -
Update
webpack-bundle-analyzer
bundled plugin to v4.3.0. #146 -
Internal: Add the generation of a basic development and production bundle, including scss styles, to the CI job. #149
-
Internal: Upgrade local development dependencies to latest versions. #150
- Introduce support for filtering entire stylesheet loader chain by matching against the special
loaderKey
value "stylesheet" when passing afilterLoaders
method into a preset. #124 - The bundled version of
terser-webpack-plugin
has been upgraded from 3.1.0 to 4.2.0. Consult the breaking changes interser-webpack-plugin
4.0 if you utilize this plugin with any custom configuration or options. #123 - The bundled version of
css-loader
has been upgraded from 3.6.0 to 4.3.0. Consult the breaking changes incss-loader
4.0 if you utilize this loader with any custom configuration or options. #120 - The bundled version of
sass-loader
has been upgraded from 9.0.3 to 10.0.2. Consult the breaking changes insass-loader
10.0 if you utilize this loader with any custom configuration or options. #119 - The bundled version of
mini-css-extract-plugin
has been upgraded from 0.9.0 to 0.11.2. #122
- Fix issue where
plugins.clean()
triggered an error. #106
- Permit
withDynamicPort
helper to work with multi-configuration Webpack files. #103
- Breaking: End support for Node v8. Node v10.13 or later is now required.
- Breaking: Remove
fix-style-only-entries
plugin from production preset. This plugin can incorrectly remove files in certain multi-configuration scenarios. #93 - Breaking: Update
clean-webpack-plugin
factory to reflect API changes in the latest bundled version.plugins.clean()
can now be added to a webpack configuration'splugins
array with no additional arguments. #31 - Breaking: Update
copy-webpack-plugin
factory to reflect API changes in the latest bundled version.plugins.copy()
now takes a sole object argument specifying apatterns: []
array key, where before patterns were passed as a first argument. #96 - Breaking: End support for TypeScript 3.5 and earlier following upgrate to latest
ts-loader
. #102 - Switch optional SCSS dependency from
node-sass
tosass
(a pure JavaScript implementation ofdart-sass
), to avoid the need to compile our sass dependency. - Introduce
withDynamicPort
helper function to simplify implementation of open port fallback logic. #89 - Output CSS sourcemaps in production if
devtool
option is set. #94 - Add postcss-preset-env to postcss webpack configuration and configure it to transform Stage 3 CSS features #91
- Resolve issue where
{bundle name}.LICENSE.txt
files were output by Terser in situations where these files were not generated prior to 0.7.0. #51
- Include
plugins.fixStyleOnlyEntries()
in the production preset. #33 - Bump dependency versions to resolve
npm audit
security warnings. #40copy-webpack-plugin
has been upgraded from 4.6 to 5.1.1. Consult the breaking changes incopy-webpack-plugin
5.0 if you utilize this plugin with any custom configuration or options.terser-webpack-plugin
has been upgraded from 1.3 to 32.3.5. Consult the breaking changes interser-webpack-plugin
2.0 if you utilize this plugin with any custom configuration or options. Several flags in our Terser configuration withinplugins.js
have been removed because those options are now Terser's default behavior.
- Set
emitWarning: true
in development preset'seslint-loader
configuration so that lint errors do not block hot updates. #39
- Add TypeScript support. If the
typescript
package is detected, the presets will usets-loader
to interpret.ts
and.tsx
files. #38 - Add default
chunkFilename
to output configuration to ensure chunks are generated using hashed filenames. #34
- Fix bug where bundle keys in the
entry
configuration object were not respected. #30
- Provide default values for
entry
andoutput.path
configuration options. #28 - Update
externals
to include latest WordPress core package names. #26 - Add
@babel/plugin-proposal-class-properties
plugin to permit use of class instance properties. #24 - Cache babel preset configuration for performance. #23
- First public release (remove beta notice from README).
- Release documentation site.
- Bundle
block-editor-hmr
package. #15 - Revert
plugins.fixStyleOnlyEntries()
to the official version ofwebpack-fix-style-only-entries
plugin. #21 - Only inject
eslint-loader
ifeslint
is installed. #16 - Add a reusable preset babel configuration as
@humanmade/webpack-helpers/babelrc-preset
. #13 - Remove
package-lock.json
from distributed npm package. #6
- Add OptimizeCssAssets plugin to production preset.
- Throw errors on port conflict instead of using
console.error
andprocess.exit
.
- First usable beta.