Symfony
sponsored by SensioLabs
Menu
  • About
  • Documentation
  • Screencasts
  • Cloud
  • Certification
  • Community
  • Businesses
  • News
  • Download
  1. Home
  2. Documentation
  3. Frontend
  4. Encore Versus Assetic?
  • Documentation
  • Book
  • Reference
  • Bundles
  • Cloud
Search by Algolia
  • Should I Upgrade from Assetic to Encore

Encore Versus Assetic?

Edit this page

Warning: You are browsing the documentation for Symfony 4.0, which is no longer maintained.

Read the updated version of this page for Symfony 6.2 (the current stable version).

Encore Versus Assetic?

Symfony originally shipped with support for Assetic: a pure PHP library capable of processing, combining and minifying CSS and JavaScript files. And while Encore is now the recommended way of processing your assets, Assetic still works well.

So what are the differences between Assetic and Encore?

  Assetic Encore
Language Pure PHP, relies on other language tools for some tasks Node.js
Combine assets? Yes Yes
Minify assets? Yes (when configured) Yes (out-of-the-box)
Process Sass/Less? Yes Yes
Loads JS Modules? [1]_ No Yes
Load CSS Deps in JS? [1] No Yes
React, Vue.js support? No [2]_ Yes
Support Not actively maintained Actively maintained
.. [1] JavaScript modules allow you to organize your JavaScript into small files

called modules and import them:

1
2
3
4
5
// require third-party modules
var $ = require('jquery');

// require your own CoolComponent.js modules
var coolComponent = require('./components/CoolComponent');

Encore (via Webpack) parses these automatically and creates a JavaScript file that contains all needed dependencies. You can even require CSS or images.

.. [2] Assetic has outdated support for React.js only. Encore ships with modern
support for React.js, Vue.js, TypeScript, etc.

Should I Upgrade from Assetic to Encore

If you already have Assetic working in an application, and haven't needed any of the features that Encore offers over Assetic, continuing to use Assetic is fine. If you do start to need more features, then you might have a business case for changing to Encore.

This work, including the code samples, is licensed under a Creative Commons BY-SA 3.0 license.
We stand with Ukraine.
Version:
Online exam, become Symfony certified today

Online exam, become Symfony certified today

Symfony Code Performance Profiling

Symfony Code Performance Profiling

↓ Our footer now uses the colors of the Ukrainian flag because Symfony stands with the people of Ukraine.

Avatar of g123456789l, a Symfony contributor

Thanks g123456789l for being a Symfony contributor

1 commit • 2 lines changed

View all contributors that help us make Symfony

Become a Symfony contributor

Be an active part of the community and contribute ideas, code and bug fixes. Both experts and newcomers are welcome.

Learn how to contribute

Symfony™ is a trademark of Symfony SAS. All rights reserved.

  • What is Symfony?
    • Symfony at a Glance
    • Symfony Components
    • Case Studies
    • Symfony Releases
    • Security Policy
    • Logo & Screenshots
    • Trademark & Licenses
    • symfony1 Legacy
  • Learn Symfony
    • Symfony Docs
    • Symfony Book
    • Reference
    • Bundles
    • Best Practices
    • Training
    • eLearning Platform
    • Certification
  • Screencasts
    • Learn Symfony
    • Learn PHP
    • Learn JavaScript
    • Learn Drupal
    • Learn RESTful APIs
  • Community
    • SymfonyConnect
    • Support
    • How to be Involved
    • Code of Conduct
    • Events & Meetups
    • Projects using Symfony
    • Downloads Stats
    • Contributors
    • Backers
  • Blog
    • Events & Meetups
    • A week of symfony
    • Case studies
    • Cloud
    • Community
    • Conferences
    • Diversity
    • Documentation
    • Living on the edge
    • Releases
    • Security Advisories
    • SymfonyInsight
    • Twig
    • SensioLabs
  • Services
    • SensioLabs services
    • Train developers
    • Manage your project quality
    • Improve your project performance
    • Host Symfony projects
    Deployed on
Follow Symfony
Search by Algolia