[英]AWS Elastic Beanstalk: Do I have to deploy my app with full “/node_modules” and “/bower_components” and compiled sass and other dependencies?
我不了解Node.js應用程序中AWS Elastic Beanstalk的工作方式。 Node.js開發的最佳實踐表明,不必將/node_modules
或/bower_components
或其他第三方軟件包推送到版本控制系統(例如GitHub),只需將package.json
推/node_modules
。 所有這些/node_modules
必須在.gitignore
。 然后任何人都可以執行npm install
或bower install
並安裝所有依賴項。 對於sass
-編譯它們以用於生產環境。
好的,但是AWS Elastic Beanstalk呢? 我必須如何創建Node.js應用程序的源包? 我是否必須提交FULL /node_modules
和/bower_components
,然后將它們與.zip
捆綁在一起? 但是我的HEAD提交沒有/node_modules
,因為/node_modules
在.gitignore
。 因此, .zip
捆綁包中將沒有依賴項:
git archive --format=zip HEAD > app.zip
還是在將app.zip
部署到AWS Elastic Beanstalk之后是否可以選擇安裝所有依賴項?
還是在我上載app.zip
捆綁包后立即將npm install
本身自動npm install
在引擎蓋下的某個app.zip
?
在使用got部署應用程序時,Elastic Beanstalk運行一些npm命令。 幾個月前,我做了一個小實驗 。
簡而言之,您可以使用npm install
來部署您的依賴項,然后使用npm prestart
來構建和編譯sass之類的東西。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.