3

I am not particularly experienced with either npm or webpack. I have a fairly small project that builds very quickly locally (much less than a minute), yet takes a ridiculously-long time to run on our test server.

in package.json the code is "scripts": { "build": "webpack --config webpack.prod.js", ...

Running npm run build executes very quickly on my local development machine. It uses copy-webpack-plugin as described here to build a directory of static content.

When I attempt to do the same from our test server (after getting exact same files from github), the npm run build command takes well more than half an hour - if it completes at all before I give up and just manually copy over the relevant files from my local dev.

susie derkins
  • 482
  • 1
  • 5
  • 16
  • Is your test server internally maintained or do you use a cloud service? It's very hard to pinpoint your precise issue without more information and details of the test server but one suggestion could be that your tests are being queued and the server is under an insurmountable load at the moment. – J. Stott Jun 03 '19 at 16:15
  • You are correct that there are quite a few possibilities and that I didn't give a lot of details. I wasn't sure what would be helpful and what would be just noise. Our server is on an EC2 instance with aws. it's a micro instance, and I'm not expecting world-beating performance, but I am surprised at the utter lack of performance. (if there is load on the server, it is unrelated to our site, as it has very little traffic as of yet) – susie derkins Jun 04 '19 at 01:21
  • @susiederkins What about the performance of the npm install / npm ci command? – MattDiMu Jun 04 '19 at 06:28
  • @MattDiMu npm install is also brutally slow on the server (but perfectly quick on my development machine). The last time I ran it it seemed to hang - I killed it and then ran `npm install --verbose`, which worked as quickly as running locally does. I am not familiar with npm ci but will look into it. – susie derkins Jun 05 '19 at 00:51

0 Answers0