Search code examples
symfonywebpackphpstorm

Integration of Webpack to PhpStorm


I am trying to integrate Webpack to PhpStorm (to my Symfony 4 application).

Everything works fine (building JS and CSS files, ...) but the IDE doesn't suggest when I am including built files in twig template using asset function:

as you can see here

I have this in my config/packages/framework.yaml

framework:
   assets:
    json_manifest_path: '%kernel.project_dir%/public/build/manifest.json'

And this in package.json

 "devDependencies": {
        "@symfony/webpack-encore": "^0.17.0"
 },

Is there anything more I need to set to make this work?


Solution

  • I managed to solve this problem. You have to config Symfony plugin for PhpStorm to use Symfony 4 directory hierarchy (web was renamed to public, ...). This configuration can be found in File -> Settings -> Languages & Frameworks -> PHP -> Symfony.