How to Compile Assets in Symfony 6 | Compile CSS & JS | Symfony 6 for Beginners | Learn Symfony 6

preview_player
Показать описание
This video will show you how you can compile your assets (CSS & JS) in Symfony 6 - Want to learn an incredible open-source PHP framework? Symfony is one of the most popular frameworks when you need to build high-performance & complex web applications.

📚 New Udemy Course

📲 Let’s plan a meeting

💌 Newsletter

🔥 Resources

Want to learn more?

📋 Table of Content
- Github Symfony Encore
00:00 - Setup & New Files
03:57 - Compiling our CSS
08:52 - Compiling our JavaScript

#symfony #framework #symfony6 #php
Рекомендации по теме
Комментарии
Автор

This file can not be found, please check it for typos or update it if the file got moved. It is 2024 right now I see this video came out in 2022??? So I am on version 6.4 atm. Seems symfony has made some changes with the --webapp flag that nullifies using encore? Anyway, the solution I found was suggested to recreate the application without the --webapp flag, basically a bare bones installation. I am sure this will create more headaches as this goes along. Otherwise, pretty good tutorial.

matorres
Автор

Great video! Darynazar you didn't mention running npm install before running npm run dev. Without with it will give error about encore dev. But I see in video that you have already package-lock.json so you run it before recording video :)

ilyasbakirov
Автор

"./" doesn't go back one directory. It's a pointer to the current directory (/assets/). If you like to go back or up one directory, you have to write "../" (which would be wrong here).

dominquehopp
Автор

Tip: if you run npm run watch before adding method1.js in app.js and method2.js in webpack you will got compiled only method1.js. To get method2.js in build folder you need run npm run dev.

ilyasbakirov
Автор

Thanks a lot for this.
It's really helpful for me

ummehanyarozshandaanny
Автор

ahhh javascript isnt showing up for me :( i get no errors in the browser and terminal, everything seems fine i just dont see the alert and console log in the browser…..

gayspunchbop
Автор

is there a way to define functions also and call them inside twig

drazen.antunovic
Автор

Hey, great video. However I've discovered, that I do not get the asset/controller folder after running composer require Nor the bootstrap.js file. Just the app.js and asset/styles/app.css. What step is missing?
Cheers

Sasfatu
Автор

Friends, deleting/editing these lines can lead to various problems:

{% block stylesheets %}
{{ encore_entry_link_tags('app') }}
{% endblock %}

{% block javascripts %}
{{ }}
{% endblock %}

kholodnov
Автор

ENCORE is the stupidest, incomprehensible and redundant project that has ever been in programming.

qkenkenu