1
我在我的Symfony heroku應用程序中添加了一個heroku/nodejs buildpack,我可以安裝我的紗線依賴項。如何用Webpack Encore編譯Heroku上的資源?
但是我不能夠運行
$ yarn run encore production
我總是有相同的錯誤Command "encore" not found
我是否在composer.json運行命令:
// composer.json
"compile": [
"node_modules/.bin/encore production",
[•••]
或的package.json
//package.json
"scripts": {
"heroku-postbuild" : "yarn run encore production"
[•••]
我終於修好了。我的錯誤是遵循Webpack Encore文檔,該文檔建議僅爲開發依賴項安裝Webpack Encore。我想這與heroku環境(?)無關。我把所有的紗線依賴關係都安裝在package.json的'''dependencies''中,而不是''devDependencies''中,它可以工作! – Ousmane