OverviewΒΆ

Note

If you’re still using Gulp consider switching to Webpack (as it became our default build tool) using our guide.

RequirementsΒΆ

We recommend using Node.js 16.x as it is the current LTS version. However, Sylius frontend is also compatible with Node.js 14.x and 18.x.

In Sylius, we use yarn as a package manager, but there are no obstacles to using npm.

Stack overviewΒΆ

Sylius frontend is based on the following technologies:

  • Semantic UI
  • jQuery
  • Webpack

Of course, it is not a complete list of packages we use, but these are the most important. To see all packages used in Sylius check the package.json file.

Webpack vs GulpΒΆ

For a long time, the Gulp was the default build tool for Sylius. Since version 1.12, Gulp has been replaced by Webpack. Gulp’s configs are still present due to compatibility with previous versions, but we do not recommend using them anymore.

Webpack EncoreΒΆ

To improve the experience of using Webpack with Sylius, we use the Webpack Encore package made by the Symfony team. You can read more about Encore in the official Symfony documentation.

Assets structureΒΆ

We provide the following assets directory structure:

<project_root>
β”œβ”€β”€ assets
β”‚   β”œβ”€β”€ admin <- all admin-related assets should be placed here, they are only included when you are in the admin panel
β”‚   β”‚   β”œβ”€β”€ entry.js <- entry point for admin assets, do not remove nor rename it unless you know what you do
β”‚   β”œβ”€β”€ shop <- all shop-related assets should be placed here, they are only included when you are in the shop
β”‚   β”‚   β”œβ”€β”€ entry.js <- entry point for shop assets, do not remove nor rename it unless you know what you do

When you want to add e.g. SCSS files or images your structure might look like this:

<project_root>
β”œβ”€β”€ assets
β”‚   β”œβ”€β”€ admin
β”‚   β”‚   β”œβ”€β”€ entry.js
β”‚   β”œβ”€β”€ shop
β”‚   β”‚   β”œβ”€β”€ styles
β”‚   β”‚   β”‚   β”œβ”€β”€ app.scss
β”‚   β”‚   β”œβ”€β”€ images
β”‚   β”‚   β”‚   β”œβ”€β”€ logo.png
β”‚   β”‚   β”œβ”€β”€ entry.js

If you want to know how to import and manage those assets take a look at our Managing assets guide.