我创建了一个symfony项目 . 为了管理js和css我按照symfony官方的建议使用webpack安可 . 在开发环境中,每个人都运作良好 . yarn run encore dev为我的资产创建正确的路径 .

我的HTML的一个例子

link href="{{ asset('build/page-connexion/connexion.css') }}"

请求的URL是

http:// localhost:8000 / build / footer / footer.css

但是在 生产环境 中,当我运行“纱线运行安可 生产环境 ”路径不正确时,页脚的请求URL是

http://mydomain.fr/build/footer/footer.css

它应该是http://mydomain.fr/mywebsite/public/build/footer/footer.css

如何以及在何处配置此路径?在我的HTACCESS?

我知道如果我在webpack.config.js中使用我的服务器的路径更改setPublicPath('myfullpath')它将起作用 . 但从逻辑上讲,我不需要改变它吗?

在此先感谢您的帮助