Use Babel for entire package


The 'use babel'; directive only applies directly to the file it is declared in. This means that every sub-module and file has to have the babel directive and I would rather just declare it once on the top-level module or in some configuration.

I tried using the babel require hook but it doesn’t work in Atom/Electron, see babel/babel#2590.

A solution may be to just pre-build the whole package with webpack and point the main entry to the compiled file. The atom global can be handled in webpack.config.js with externals: { 'atom': 'atom' }

Are there any better solutions?