Search code examples
babeljspreact

How to skip/ignore babel optimization for specific modules


I'm currently working on a preact app that connects with firebase.

My problem is this

30 seconds of my life....

Since adding firebase to the project watch build times get seriously affected, jumping from an average of 10s to almost a minute.

From what I read online this is merely an information and not an error (kinda obvious with the 'Note:' bit).

Question: Is there any way to disable optimization for specific modules?

Thanks


Solution

  • Enabling compact mode on its own will not have any obvious performance benefits, especially not in the magnitude you're looking for.

    Babel will still parse and transpile every module you throw at it -- what compact mode does is to give whitespace to the output. It makes it human readable. And that's all that warning is saying, that the module is so large that Babel is enabling compact mode itself for that module.