A Babel loader plugin for RequireJS.
npm install --save-dev requirejs-babel babel babel-plugin-module-resolver-standalone
Add the paths to configuration:
paths: {
es6: '...node_modules/requirejs-babel/es6',
babel: '...node_modules/@babel/standalone/babel.min',
'babel-plugin-module-resolver': '...node_modules/babel-plugin-module-resolver-standalone/index'
}
Reference files via the es6! plugin name:
define(['es6!your-es6-module'], function(module) {
// ...
});