如何覆盖 "public" 目录?

How to override the "public" directory?

我已将我的 public 目录重命名为 www,因此文档中说我已在 composer.json 文件中添加了一些行:

"extra": {
    "...": "...",
    "public-dir": "www"
}

那我运行composer update.

不过好像不行。

我有这个错误:

An exception has been thrown during the rendering of a template ("Asset manifest file "*******/public/build/manifest.json" does not exist.").

所以我在 config/packages/dev/framework.yaml 中添加了(我在开发中):

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

但是又出现了一个错误:

An exception has been thrown during the rendering of a template ("Could not find the entrypoints file from Webpack: the file "*******/public/build/entrypoints.json" does not exist.").

然后我像这样修改 webpack.config.js 文件:

Encore
    // directory where compiled assets will be stored
    .setOutputPath('www/build/')

但错误依然存在。

有重命名 public 目录的简单方法吗?

我已经解决了我的问题:

在 config/packages/webpack_encore.yaml 中:

webpack_encore:
    # The path where Encore is building the assets.
    # This should match Encore.setOutputPath() in webpack.config.js.
    output_path: '%kernel.project_dir%/www/build'