Compile global code into ES6 module code