Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

232
Views
Comando de compilación universal angular para incluir package.json en el nivel raíz de la carpeta dist

Estoy tratando de implementar mi aplicación universal angular en AWS Elastic beanstalk. Creé una canalización de código en AWS donde la salida de la compilación se envía a beanstalk elásticos. Ahora, Elastic Beanstalk necesita un archivo app.js o server.js o procfile o package.json para ejecutar la aplicación, pero mi carpeta de compilación es como la siguiente

 --dist/ --Appname/ --browser/ --server/ -- //here I am expecting package.json file

Mi problema: estoy tratando de construir angular universal pero quiero incluir package.json en el nivel raíz de dist. carpeta. Probé varios enfoques, pero el paquete.json va a la carpeta del navegador de compilación.

A continuación se muestra lo que probé:

Angular.json

 "assets": [ "src/favicon.ico", "src/assets", { "glob": "package.json", "input": "./", "output": "/" } ],

También probé la solución en este enlace.

También debajo está mi archivo buildspec en AWS

 version: 0.2 env: variables: CACHE_CONTROL: "86400" S3_BUCKET: "arn:aws:s3:::devemr.growthemr.com" BUILD_FOLDER: "dist" phases: install: runtime-versions: nodejs: 10 commands: - echo Installing source NPM dependencies... - npm install - npm install -g @angular/cli@next build: commands: - echo Build started - npm run build:ssr post_build: commands: - bash -c "if [ /"$CODEBUILD_BUILD_SUCCEEDING/" == /"0/" ]; then exit 1; fi" - aws s3 rm s3://devemr.growthemr.com --recursive - echo S3 bucket is cleared. artifacts: files: - '**/*' base-directory: 'dist'

Cualquier solución será muy apreciada. Gracias por adelantado

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Veo que está intentando ejecutar el archivo js principal que se genera después de la compilación en caso de ssr. Para ejecutarlo, necesita un script o Procfile según la documentación de aws. Para hacer esto, agregué Procfile a mi cubo s3 y luego ejecuté el comando de compilación

archivo buildspec

 build: commands: - echo Build started - npm run build:ssr post_build: commands: - aws s3 cp s3://yourbucketname/Procfile ./dist - bash -c "if [ /"$CODEBUILD_BUILD_SUCCEEDING/" == /"0/" ]; then exit 1; fi" # - aws s3 rm s3://devemr.growthemr.com --recursive - echo S3 bucket is cleared. # - aws cloudfront create-invalidation --distribution-id=E26GLI30EJTNBB --paths '/*' artifacts: files: - '**/*' base-directory: 'dist'

Además, no olvide agregar el permiso en su cubo s3 como se muestra a continuación

 { "Version": "2012-10-17", "Statement": [ { "Sid": "PublicReadGetObject", "Effect": "Allow", "Principal": "*", "Action": "s3:*", "Resource": [ "arn:aws:s3:::bucketname", "arn:aws:s3:::bucketname/*" ] } ] }
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!