razzle
razzle copied to clipboard
Invert config loading in babel-loader, pass caller to config
https://github.com/jaredpalmer/razzle/blob/alpha/packages/razzle-babel-loader/src/loader/get-config.ts#L179
Set babelrc to true and call loadPartialConfig, later set to false and call loadPartialConfig again
Cached Babel config loading will be per filetype, module type, razzle target. So only toplevel Babel config works. If relative ones are found before they will be cached instead
Pass a minimal options with caller to loadPartialConfig first with babelrc set to true. Add a option to babel-loader to say if we want the loader to add plugins. Possibly allow prepend, append or replace so it easy to not get in the way of customizations.
then pass the options to loadOptions and then to loadPartialConfig again.