How to stop babel from transpiling 'this' to 'undefined' (and inserting “use strict”)
问题 EDIT : This is not about fat arrows . It\'s also not about passing this to an IIFE . It\'s a transpiler-related question. So I\'ve created a simple pub-sub for a little app I\'m working on. I wrote it in ES6 to use spread/rest and save some headaches. I set it up with npm and gulp to transpile it but it\'s driving me crazy. I made it a browser library but realized it could be used anywhere so I decided to make it Commonjs and AMD compatible. Here\'s a trimmed down version of my code: