Explore Courses Blog Tutorials Interview Questions
0 votes
in DevOps and Agile by (29.3k points)

We are using React on Rails within our Rails app. When we deploy, asset pre-compilation takes ~20 minutes.

Based on the deploy logs, it appears as though most of this time is spent pre-compiling a 3.3MB javascript file. That file "app.js" concatenates two files which are generated by webpack:

# app.js

//= require vendor-bundle (250KB)

//= require app-bundle  (3.3MB)

Should we just come to expect long pre-compile times given the size of the app-bundle? Or, can we improve things?

As an additional note, we tried directly compiling app-bundle, instead of requiring it through app.js, and it took the same amount of time.

1 Answer

0 votes
by (50.2k points)

It is hard to answer this question without knowing what leads to this error and this needs a debugging but as of now I came to this problem once, I would suggest you break the code into a new project which will help you to connect your Rails app through API and with this the complexity of your devops and deployment pipeline will greatly be reduced. I came to this conclusion after debugging. Hope this information will give a basic idea about how to approach your problem.  

Related questions

Browse Categories