FindL
FindL

Reputation: 531

Symfony 4 - Assets folder not found

According to Symfony Best Practices,

Store your assets in the assets/ directory at the root of your project.

But currently, I don't have this folder created and if I create it, I got the error telling me that ressources can't be found.

I tried composer require webassets , but don't working.

Anyone have the solution ?

Regards

Upvotes: 1

Views: 6315

Answers (3)

  1. Enable the encore composer require encore
  2. update yarn yarn install

Upvotes: 0

Placing assets folder in root directory is best practice. Reason that root directory cannot be accessible from outside. You should try Symfony's Webpack Encore plugin. It compiles your minimized and compressed assets into public folder so they can never be shown as original.

If that is not fit your interest just put your whole assets folder into public directory.

Upvotes: 2

Tomcky
Tomcky

Reputation: 1

You try following command.

$ composer require encore
$ yarn install

May be good to refer to here.
http://symfony.com/doc/current/frontend/encore/installation.html

Upvotes: 0

Related Questions