Skip to content

Releases: symfony/webpack-encore

v0.26.0 useBuiltIns Behavior change, style resolving & integrity support

29 Mar 14:12
Compare
Choose a tag to compare

We did it! Another release! 🥇

To upgrade:

  1. Update your package.json file: set the @symfony/webpack-encore version to ^0.26.0.

  2. Run yarn upgrade!

Changes: v0.25.0..v0.26.0

  • [Behavior change] The Babel useBuiltIns option default value changed
    from entry to false, which means that polyfills may no longer be
    provided in the same way. This is due to a change in Babel and core-js.
    To get the same functionality back, run yarn add core-js --dev, then use:

    Encore.configureBabel(() => {}, {
        useBuiltIns: 'entry', // or try "usage"
        corejs: 3
    })

    This comes from #545 thanks to @Lyrkan.

  • Added the ability to "resolve" CSS and Sass files without specifying
    the file extension and by taking advantage of the sass or style
    attribute in an npm package. For example, you can now import the main
    Bootstrap SASS file from within a SASS file by saying @import ~bootstrap.
    This will use the sass attribute from the bootstrap package.json
    file to find which file to load. #474 thanks to @deAtog.

  • Added a new Encore.enableIntegrityHashes(), which will cause a new
    integrity key to be added to entrypoints.json with integrity values
    that can be included in the script or link tag for that asset - #522
    thanks to @Lyrkan.

  • Allow some parts of configureBabel() to be used, even if there is
    an external .babelrc configuration file - #544 thanks to @Lyrkan.

v0.25.0 Upgraded dependencies, features, bug fixes

26 Mar 00:14
Compare
Choose a tag to compare

We did it! Another release!

To upgrade: yarn upgrade

Changes: v0.24.0..v0.25.0

Documentation: http://symfony.com/doc/current/frontend.html

Highlights:

  • [BC BREAK] Various dependency versions were updated, including
    css-loader updated from ^1.0.0 to ^2.1.1 and resolve-url-loader
    updated from ^2.3.0 to ^3.0.1. The minimum Node version was
    also bumped from 6 to 8. See #540 for more details.

  • Added Encore.disableCssExtraction() if you prefer your CSS to
    be output via the style-loader - #539 thank to @Lyrkan.

  • Added Encore.configureLoaderRule() as a way to configure the
    loader config that Encore normally handles - #509 thanks to @Kocal.

  • Babel cache is no longer used for production builds to avoid a
    bug where the cache prevents browserslist from being used - #516
    thanks to @Lyrkan.

v0.23.0 Faster builds, vue module support & more

02 Feb 19:24
Compare
Choose a tag to compare

Hi friends!

Ah, another nice release powered by the community!

Changes: v0.22.4..v0.23.0

Highlights:

  • Add support for CSS modules in Vue - #508 thanks to @Lyrkan

  • Store externals in an array - #495 thanks to @deAtog

  • Add Encore.isRuntimeEnvironmentConfigured() - #500 thanks
    to @stof.

  • Add the ability to configure watch options - #486 thanks
    to @Kocal

  • Enabled cache and parallelism for terser for faster builds -
    #497 thanks to @Kocal

v0.22.4 - Fixing Vue + Typescript bug & other minor things

05 Jan 17:02
Compare
Choose a tag to compare

Yes! A new release - but just some minor fixes.

To upgrade: yarn upgrade

Changes: v0.22.3..v0.22.4

Documentation: http://symfony.com/doc/current/frontend.html

Highlights:

  • #483 Add new methods isDev() and isDevServer() - thanks to @Kocal
  • #484 Allow to import .vue files when using TypeScript - thanks to @Lyrkan
  • #485 Fix small mistakes in shared-entry-concat-plugin.js and validator.js - thanks to @Lyrkan

v0.22.3 - Security release

05 Jan 16:59
Compare
Choose a tag to compare

A quick security release!

To upgrade: yarn upgrade

Changes: v0.22.2..v0.22.3

Documentation: http://symfony.com/doc/current/frontend.html

See #481 - this release guarantees that you are using a version of webpack-dev-server that does not contain the security issue.

v0.22.2: Important bug fixes to versioning & caching

29 Nov 15:58
Compare
Choose a tag to compare

This bug fix release includes several important changes that fix some versioning bugs and improve caching.

To upgrade: yarn upgrade

Changes: v0.22.1..v0.22.2

Highlights:

  • Fix an issue where JavaScript files might change, but their versioning hash filename would NOT change - causing problems where users would use out-of-date cached assets, instead of dowloading the new ones. This works by, internall, using the names of modules in compiled files. This bug only affected users using enableSingleRuntimeChunk() - #462

  • Fixed a bug where certain content changes to a JavaScript file would not cause the versioning hash to update. This relates to the first fixed bug. Due to the changing in how hashing works, all JavaScript files will have a new hash the first time after upgrading - #463

  • Fixed a bug with splitEntryChunks() where some filenames and contents of files would change unnecessarily. This did not cause any bad behavior, but meant that users would unnecessarily download new assets, that really didn't need to change between builds. As a result, you'll notice that instead of split chunks named something like vendors~abc123.js, in production, they will be called 0.js or some other integer. This makes no functional difference - #462

v0.22.1 Bug fix for production sourcemaps

17 Nov 20:25
Compare
Choose a tag to compare

Just a bug fix release!

  • Bug #454 was fixed, where a recent change made CSS sourcemaps always output in production.

v0.22.0 [BC Break] Change to Opening Slash in entrypoints.json

17 Nov 20:24
Compare
Choose a tag to compare

Ok! A new release! This one contains a minor, but important BC break:

  • [BC BREAK] The values/paths in entrypoints.json were previously
    stripped of their opening slash. That behavior has been changed:
    the opening slash is now included: Before: build/foo.js, After: /build/foo.js.

For Symfony users with a standard setup, this should not be noticeable as the paths were already "fixed" via the manifest.json lookup.

Bug fixes & updating dependencies

16 Nov 14:23
Compare
Choose a tag to compare

What's better than Encore on Webpack 4? Encore on Webpack 4 with a few bugs squashed!

Highlights:

  • #439 updating resolve.extensions to include webpack4 default extensions
  • #440 updating css-loader dep and ts-loader dev dep
  • #441 Appending the _tmp_shared contents via an earlier hook
  • #451 pretty-printing entrypoints.json

Happy Webpacking!

v0.21.0: The Webpack 4 Release!

05 Nov 18:21
Compare
Choose a tag to compare

Webpack 4 and so much more 🎇! This is a huge release that contains some backwards-compatibility breaks or changes.

To upgrade, change your version constraint to ^0.21.0 and run yarn upgrade.

You may also need to make a few other changes if you're a Symfony user:

  • composer require symfony/webpack-encore-bundle
  • Replace your manual script and link tags with the new encore_entry_script_tags() and encore_entry_link_tags() functions from that bundle.

Highlights

  • [BC BREAK] Webpack was upgraded to version 4. This includes a number of major
    and minor changes. The changes are listed below under the
    Webpack 4 Upgrade section.

  • [DEPRECATION] You must now call either Encore.enableSingleRuntimeChunk()
    or Encore.disableSingleRuntimeChunk(): not calling either method is
    deprecated. The recommended setting is Encore.enableSingleRuntimeChunk().
    This will cause a new runtime.js file to be created, which must be included
    on your page with a script tag (before any other script tags for Encore
    JavaScript files). See the documentation above enableSingleRuntimeChunk() in
    index.js for more details.

  • [BEHAVIOR CHANGE] Previously, without any config, Babel was
    configured to "transpile" (i.e. re-write) your JavaScript so
    that it was compatible with all browsers that currently have
    more than 1% of the market share. The new default behavior
    is a bit more aggressive, and may rewrite even more code to
    be compatible with even older browsers. The recommendation
    is to add a new browserslist key to your package.json file
    that specifies exactly what browsers you need to support. For
    example, to get the old configuration, add the following to
    package.json:

{
    "browserslist": "> 1%"
}

See the browserslist library
for a full description of all of the valid browser descriptions.

  • Added a new copyFiles() method that is able to copy static files
    into your build directory and allows them to be versioned. #409
    thanks to @Lyrkan

  • Introduced a new configureSplitChunks() method that can be
    used to further configure the optimizations.splitChunks configuration.

  • A new entrypoints.json file is now always output. For expert
    use-cases, the optimizations.splitChunks.chunks configuration
    can be set via configureSplitChunks() to all. Then, you
    can write some custom server-side code to parse the entrypoints.js
    so that you know which script and link tags are needed for
    each entry.

  • The "dynamic import" syntax is now supported out of the box
    because the @babel/plugin-syntax-dynamic-import babel plugin
    is always enabled. This allows you to do "Dynamic Imports"
    as described here: https://webpack.js.org/guides/code-splitting/#dynamic-imports

  • A new "version check" system was added for optional dependencies.
    Now, when you install optional plugins to support a feature, if
    you are using an unsupported version, you will see a warning.
    "Package recommendation" errors (i.e. when you enable a feature
    but you are missing some packages) will also contain the version
    in the install string when necessary (e.g. yarn add foo@^2.0).

  • Support was added handlebars-loader by calling enableHandlebarsLoader().
    #301 thanks to @ogiammetta

  • Support was added for eslint-loader by calling enableEslintLoader().
    #243 thanks to @pinoniq

  • The css-loader can now be configured by calling configureCssLoader().
    #335 thanks to @XWB

  • It's now possible to control the exclude for Babel so that you can
    process certain node_modules packages through Babel - use
    the new second argument to configureBabel() - #401 thanks to
    @Lyrkan.

Webpack 4 Upgrade Details

  • Node 7 is no longer supported. This is because the new
    mini-css-extract-plugin does not support it (and neither)
    does Yarn.

  • For Preact, the necessary plugin the user needs to install
    changed from babel-plugin-transform-react-jsx to @babel/plugin-transform-react-jsx.

  • The NamedModulesPlugin was removed.

  • The babel-preset-env package (which was at version ^1.2.2) was
    removed in favor of @babel/preset-env.

  • ExtractTextPlugin was removed and replaced with
    mini-css-extract-plugin. Accordingly, extractTextPluginOptionsCallback()
    was removed.

  • Support for CoffeeScript was entirely removed.

  • Actual lang="sass" no longer works for Vue. However, lang="scss"
    continues to work fine.

  • uglifyjs-webpack-plugin was replaced by terser-webpack-plugin.
    If you're using configureUglifyJsPlugin(), please switch to
    configureTerserPlugin() instead.