我在我的 Symfony heroku 应用程序中添加了 heroku/nodejs 构建包,并且我能够安装我的 yarn 依赖项。
但是我无法运行
$ yarn run encore production
无论我在composer.json中运行命令,我总是遇到相同的错误未找到命令“encore”
:
// composer.json
"compile": [
"node_modules/.bin/encore production",
[•••]
或者在package.json中
//package.json
"scripts": {
"heroku-postbuild" : "yarn run encore production"
[•••]
最佳答案
在你的 package.json 根文件中:
"scripts": { ... "heroku-postbuild" : "node_modules/.bin/encore production" }
It will run your webpack encore and running your others npm modules.
关于symfony - 如何使用 Webpack Encore 在 Heroku 上编译资源?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46671775/