Search code examples
symfonyassetssymfony4

Assets not install in symfony 4


I read symfony documentation for Web Assets and create /assets directory in root of my project then run command php bin/console assets:install but get:

[OK] No assets were provided by any bundle.

I store one CSS file in assets directory but didn't install in /public

how should I do?


Solution

  • The web assets documentation for Symfony 4 recommends using Webpack Encore. The assets:install command is not used in this configuration.

    Here's what you have to do according to the documentation :

    • Install Node.js and Yarn on your computer.
    • Install Encore into your project with : yarn add @symfony/webpack-encore --dev
    • Configure webpack / Encore by editing (or creating) the webpack.config.js file as described here.
    • Compile your assets by running : yarn run encore dev