use Module::Runtime qw(use_module);
use JSON::MaybeXS;
use Moo;
-use Hash::Merge qw(merge);
use JSONY;
with 'App::SCS::Role::PageChildren';
my $extracted = $self->${\"_extract_from_${type}"}($raw);
my $jsony = JSONY->new;
- my $config = reduce { merge($a, $jsony->load($b->all)) } [], @config_files;
- $extracted->{plugins} = $jsony->load($extracted->{plugins});
-
- my $setup = $extracted;
-
- $setup->{plugin_config} = merge($extracted->{plugins}, $config);
+ my $setup = {
+ %$extracted,
+ plugin_config => [
+ map @{$jsony->load($_)}, (
+ $extracted->{plugins},
+ (map $_->all, reverse @config_files), # apply config deepest first
+ )
+ ]
+ };
try {
my $tmp_cache = io($cache_name . ".tmp");