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

Поділитися
Вставка
  • Опубліковано 10 гру 2024

КОМЕНТАРІ • 25

  • @ilyasbakirov
    @ilyasbakirov 2 роки тому +6

    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 :)

    • @codewithdary
      @codewithdary  2 роки тому +2

      Whoops, I think that I cut that part out by accident when I was trying to shorten the composer install section, hehe thank you.

    • @ilyasbakirov
      @ilyasbakirov 2 роки тому +1

      @@codewithdary Not at all! Keep up the good work!

    • @codewithdary
      @codewithdary  2 роки тому +1

      @Ilyas Bakirov will do my friend!

    • @MexicanintheKitchen
      @MexicanintheKitchen 2 роки тому +1

      Came looking for this, thanks!

  • @matorres74
    @matorres74 8 місяців тому +1

    So far this course is excellent. I am using to get back into symfony as the last version I used was around 3 I think. I haven't had a problem until this video (front end stuff is always a hassle). When running npm run dev I get an error "./assets/bootstrap.js" contains a reference to the file "@symfony/stimulus-bundle".
    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.

  • @ilyasbakirov
    @ilyasbakirov 2 роки тому

    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.

  • @Sasfatu
    @Sasfatu Рік тому +2

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

    • @danieluxury
      @danieluxury Рік тому

      Same here. Did you find out the "problem"?

    • @danieluxury
      @danieluxury Рік тому

      I ran "composer require symfony/stimulus-bundle" and the missing files were added.

    • @danieluxury
      @danieluxury Рік тому

      then I also called "npm add @symfony/stimulus-bridge @hotwired/stimulus --dev" . I am new on web development, so I am not sure what I am doing :)

  • @ummehanyarozshandaanny2846
    @ummehanyarozshandaanny2846 2 роки тому +1

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

  • @najimelguennouni873
    @najimelguennouni873 2 роки тому +2

    thank you Dary

  • @dominquehopp7360
    @dominquehopp7360 2 роки тому +1

    "./" 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).

  • @drazen.antunovic
    @drazen.antunovic Рік тому +1

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

    • @codewithdary
      @codewithdary  Рік тому

      Your function will most likely send back some kind of value which you can use

  • @kholodnov
    @kholodnov 4 місяці тому

    Friends, deleting/editing these lines can lead to various problems:
    {% block stylesheets %}
    {{ encore_entry_link_tags('app') }}
    {% endblock %}
    {% block javascripts %}
    {{ encore_entry_script_tags('app') }}
    {% endblock %}

  • @pigloo06
    @pigloo06 Рік тому +1

    noice

  • @qkenkenu
    @qkenkenu Рік тому +2

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