(#17183) Pass on parameters to recursive children in static_compiler

Pass on parameters from the top level resource to recursive children in
the static compiler.
The list of parameters to exclude is taken from the file type
implementation.