我正在学习symfony奏鸣曲包,我用composer create-project symfony/website-skeleton sonata
命令安装了symfony骨架项目,我进入了sonata目录并运行composer require sonata-project/admin-bundle
命令作为symfonydoc的指南,我检查了所有的配置,如doc所说,以及cache:clear
和assets:install
命令一切正常,我用php bin/console server:start
开始我的服务器,但当我访问网址'http://localhost:8000/admin/dashboard'它报告错误,An exception has been thrown during the rendering of a template ("Asset manifest file "/Users/kazuma/www/sonata/public/build/manifest.json" does not exist.").
我之前用symfony创建了我的项目,但是我对webpack知之甚少,我的资产目录是空的,当我运行npm install时它工作正常,我不知道我错过了什么。
在Symfony 4
{
"bundles": {
"Sonata\\AdminBundle\\SonataAdminBundle": ["all"]
},
"copy-from-recipe": {
"config/": "%CONFIG_DIR%/",
"src/": "%SRC_DIR%/"
}
}