Skip to content

4.0! Goodbye "peer dependency" Warnings

Compare
Choose a tag to compare
@weaverryan weaverryan released this 14 Sep 18:22
· 67 commits to main since this release

Hey packagers!

This new major release is actually smaller and has an easy upgrade path. What changed? We have moved certain dependencies (like webpack itself) out of Encore and into your project. This means 2 things:

  1. You'll need to install a few extra packages after upgrading (see notes below)
  2. You can say goodbye to those "has unmet peer dependency" warnings!

This release also makes Encore compatible with Yarn Plug'n'Play and pnpm.

Upgrading

Run:

npm install "@symfony/webpack-encore@^4.0.0" webpack webpack-cli @babel/core @babel/preset-env  --save-dev

Or:

yarn upgrade "@symfony/webpack-encore@^4.0.0"
yarn add webpack webpack-cli @babel/core @babel/preset-env --dev

And note the following BC breaks:

  • The following dependencies must be added in your package.json: webpack webpack-cli @babel/core @babel/preset-env (#1142 and #1150):
npm install webpack webpack-cli @babel/core @babel/preset-env --save-dev

# or via yarn
yarn add webpack webpack-cli @babel/core @babel/preset-env --dev
  • The following dependencies must be removed from your package.json and Babel configuration: @babel/plugin-syntax-dynamic-import @babel/plugin-proposal-class-properties,
    since they are already included in @babel/preset-env (#1150):
npm remove @babel/plugin-syntax-dynamic-import @babel/plugin-proposal-class-properties

# or via yarn
yarn remove @babel/plugin-syntax-dynamic-import @babel/plugin-proposal-class-properties

and remove it from your Encore configuration:

Encore.configureBabel((options) => {
-    config.plugins.push('@babel/plugin-proposal-class-properties');
+    
})

Changes: v3.1.0..v4.0.0

Happy Packing!