First off, thank you for all your hard work on this loader; it's been a lifesaver during our requirejs -> webpack transition!
I just started instrumenting my code with babel-plugin-istanbul and I started receiving these warnings:
[BABEL] Note: The code generator has deoptimised the styling of "unknown" as it exceeds the max of "500KB".
I tracked it back to when I use inject-loader on one of our larger modules (which is now even larger as it includes the code coverage instrumentation). By default, the compact option is set to auto:
Do not include superfluous whitespace characters and line terminators.
When set to "auto" compact is set to true on input sizes of >500KB.
I'd like to explicitly set this option to something other than auto. Right now, this PR sets it to false to reflect how this behaves the majority of the time (assuming most people aren't using inject-loader on >500KB files). true works as well and it would mean there's less work for babel to do when it transforms the AST back into code.
Aside from the compact option, I also added the filename option to assist in debugging Babel messages like the one I encountered (without the filename, it falls back to "unknown"). Adding filename means we also have to set babelrc: false to prevent it from trying to look up an external config file (which can interfere with inject-loader).
First off, thank you for all your hard work on this loader; it's been a lifesaver during our requirejs -> webpack transition!
I just started instrumenting my code with babel-plugin-istanbul and I started receiving these warnings:
I tracked it back to when I use
inject-loader
on one of our larger modules (which is now even larger as it includes the code coverage instrumentation). By default, thecompact
option is set toauto
:I'd like to explicitly set this option to something other than
auto
. Right now, this PR sets it tofalse
to reflect how this behaves the majority of the time (assuming most people aren't using inject-loader on >500KB files).true
works as well and it would mean there's less work for babel to do when it transforms the AST back into code.Aside from the compact option, I also added the
filename
option to assist in debugging Babel messages like the one I encountered (without the filename, it falls back to "unknown"). Addingfilename
means we also have to setbabelrc: false
to prevent it from trying to look up an external config file (which can interfere with inject-loader).