I'm stuck with dynamic requering es6 modules by invoking them through:
System.import('SOME_PATH').then(function (MODULE_FROM_SOME_PATH) {});
It works well with es6-module-loader
and babel runtime compilation in browser, but when i want to precompile it to ES5
syntax (for production uses) it just passes System.import
expression in code, leaving in practically untouched, just replacing System.import
with equivalent System['import']
.
I've tried gulp-babel
and babel npm
package. So when opened in browser it gives expected module loading error. How can i transpile my code to AMD
syntax for ES5
. Hoping for your help.