Skip to content

rails webpacker:compile very slow compared to bin/webpack #2564

@scottrobertson

Description

@scottrobertson

We have been having an issue for a while now with our production builds taking 4+ minutes, compared to ~30s locally.

I assumed until now that this was an issue with CI resources, however, I have since found that running bin/webpack is a huge amount faster. See below:

bundle exec rails webpacker:compile

Hash: fae915c931e9f41b0499
Version: webpack 4.42.1
Time: 211332ms
Built at: 29/04/2020 13:14:22

bin/webpack

Hash: 7ab04632a7b9a483ef83
Version: webpack 4.42.1
Time: 58670ms
Built at: 29/04/2020 13:16:03

I am clearing tmp/cache and public/packs between builds.

Any suggestions on how to debug this?

I can replicate this consistently locally, and on CI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions