Encore v2! Many Upgraded Dependencies
Hi bundlers!
This is a new major release. In Encore itself, nothing really changed. However, we upgraded many of our dependencies across new major versions. Upgrading should be easy, unless you're integrating more deeply into any of the upgraded dependencies.
To upgrade run:
yarn upgrade "@symfony/webpack-encore@^2.0.0"
Changes: v1.8.2..v2.0.0
Documentation: http://symfony.com/doc/current/frontend.html
Highlights:
This is a new major version that contains several backwards-compatibility breaks.
BC Breaks
The following dependencies were upgraded a major version. It's unlikely
these will cause problems, unless you were further configuring this part
of Encore:
clean-webpack-plugin
Version3
to4
: dropped old Node & Webpack version supportcss-loader
Version5
to6
: dropped old Node version support & CHANGELOGcss-minimizer-webpack-plugin
Version2
to3
: dropped old Node version supportloader-utils
REMOVEDmini-css-extract-plugin
Version1.5
to2.2.1
: dropped old Node & Webpack version support & CHANGELOGpretty-error
Version3.0
to4.0
: dropped old Node version supportresolve-url-loader
Version3.0
to5.0
: dropped old Node version support, requires postcss^8.0
, removerework
engine & CHANGELOGstyle-loader
Version2
to3
: dropped old Node and Webpack version support & CHANGELOGyargs-parser
Version20.2
to21
: dropped old Node version support
Additionally, Encore changed the supported versions of the following packages,
which you may have installed to enable extra features:
-
eslint
Minimum version increased from7
to8
-
eslint-webpack-plugin
Minimum version increased from2.5
to3
-
fork-ts-checker-webpack-plugin
Minimum version increased from5
to6
CHANGELOG -
less-loader
Minimum version increased from7
to10
-
postcss-loader
Minimum version increased from4
to6
-
preact
Minimum version increased from8
to10
CHANGELOG -
sass-loader
Minimum version increased from9
to12
-
stylus
Minimum version increased from0.54
to0.56
-
stylus-loader
Minimum version increased from3
to6
CHANGELOG -
vue-loader
Minimum version increased from16
to17
CHANGELOG -
Removed
Encore.enableEslintLoader()
: useEncore.enableEslintPlugin()
. -
If using
enableEslintPlugin()
with the@babel/eslint-parser
parser,
you may now need to create an external Babel configuration file. To see
an example, temporarily delete your.eslintrc.js
file and run Encore.
The error will show you a Babel configuration file you can use. -
With
configureDefinePlugin()
, theoptions['process.env']
key format
passed to the callback has changed (see #960). If you are usingconfigureDefinePlugin()
to add more items toprocess.env
, your code will need to change:
Encore.configureDefinePlugin((options) => {
- options['process.env']['SOME_VAR'] = JSON.stringify('the value');
+ options['process.env.SOME_VAR'] = JSON.stringify('the value');
})