Skip to content

Avoid running yarn install on javascript:build #118

Closed
@IsmailM

Description

@IsmailM

namespace :javascript do
desc "Build your JavaScript bundle"
task :build do
unless system "yarn install && yarn build"

At the moment, rake javascript:build runs yarn install && yarn build. In my opinion, yarn install should not be part of the javascript building step at all. If it needs to be there, there should at least be an option to disable this (e.g. by having a separate task for yarn install - which can be overwritten or via a ENV variable etc.).

css-bundling does the same thing - so if you are using both css-bundling and js-bundling gems, assets-precompile will run yarn install twice.

Not only does this take slightly longer, it means post-install scripts are run multiple times...

Also, see rails/webpacker#405.

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