I just released Module::Build::Pluggable::CPANfile to CPAN.

Module::Build::Pluggable::CPANfile is plugin for Module::Build::Pluggable to include dependencies from cpanfile.

cpan: https://metacpan.org/release/Module-Build-Pluggable-CPANfile
github: https://github.com/kazeburo/Module-Build-Pluggable-CPANfile

This is Module::Install::CPANfile for Module:Build.

Here is short sample cpanfile and Build.PL.

# cpanfile
requires 'Plack', 0.9;
on test => sub {
    requires 'Test::Warn';
};

# Build.PL
use Module::Build::Pluggable (
    'CPANfile'
);

my $builder = Module::Build::Pluggable->new(
    license              => 'perl',
    dynamic_config       => 0,
    no_index    => { 'directory' => [ 'inc' ] },
    name        => 'Foo-Bar',
    module_name => 'Foo::Bar',        
    test_files => (-d '.git' || $ENV{RELEASE_TESTING}) ? 't/ xt/' : 't/',
    recursive_test_files => 1,
    create_readme  => 1,
    create_license => 1,
);
$builder->create_build_script();

Prereqs will be dumped into (MY)?META.(yml|json)

Try it!