gpt4 book ai didi

symfony - 如何使用 Webpack Encore 在 Heroku 上编译资源?

转载 作者:行者123 更新时间:2023-12-01 22:25:01 25 4
gpt4 key购买 nike

我在我的 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com