requirejs-babel icon indicating copy to clipboard operation
requirejs-babel copied to clipboard

Can I make it as the default loader for JS files?

Open koganei opened this issue 9 years ago • 3 comments

Is there a way to make the babel loader the default loader for all JS files? That way I don't have to add es6! to my entire codebase's require calls. Thanks

koganei avatar Jan 06 '16 15:01 koganei

+1, also, if it would compile the main.js file as well when set as default, bonus!

jlaustill avatar Nov 20 '16 05:11 jlaustill

@koganei you need to add es6! only to your first module, and then add those lines to config: https://github.com/mikach/requirejs-babel/blob/master/demo/build.config.js#L14

mikach avatar Nov 21 '16 10:11 mikach

You could try integrating babel by onBuildRead instead of by a pugin.

prantlf avatar Jan 11 '18 23:01 prantlf