Skip to content
Advertisement

How does webpack-encore works with symfony 5?

I’m getting a bit mad dealing with webpack-encore in a symfony 5 project. There is few things i just don’t understand. first of all here is my webpack.config.js :

JavaScript

The thing is when i use {{ asset(‘build/images/my-image.png’) }} in my template the file is not found though it is in assets/images/my-image.png

How should i access my image??? Why it is not in manifest.json ?? Why am i not having images in my public/build/ folder ? What path should i be using to reference my image in app.css as a background-image for example ?

This thing is a nightmare to use & configure….. Thanks in advance

Advertisement

Answer

you tryed run command for build files npm run build ?

or run command for recompile automatically assets how of documentation exemple https://symfony.com/doc/current/frontend/encore/simple-example.html

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement